- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to enable crontab for user only on active ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:30 AM
тАО07-11-2006 04:30 AM
With these, I would like to hear about ideas on how to make crontabjobs only to be active on the active nodes and therefore follow the application where it is active? I am open to hear suggestions about solutions used in other places.
This scenario is only on test systems as our production systems are not using cron but instead use an external batching mechanism that goes directly to the respective node to launch the jobs as required.
MAD
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:39 AM
тАО07-11-2006 04:39 AM
Re: How to enable crontab for user only on active node?
This file controls who can run cron. You could do whatever you need to the file when the package moves around.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:45 AM
тАО07-11-2006 04:45 AM
Re: How to enable crontab for user only on active node?
build a script into the package that changes the the cron.allow and/or cron.deny list
Or if you will permit the user editing priviledges then copy the schedule in /var/spool/cron back and forth from node to node. Again, this is best done in the package script.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:46 AM
тАО07-11-2006 04:46 AM
Re: How to enable crontab for user only on active node?
e.g.
#!/usr/bin/sh
typeset CHEKFILE=/xxx/yyy/myfile.dat
typeset -i STAT=0
if [[ -f "${CHEKFILE}" && -r "${CHEKFILE}" ]]
then
echo "I'm the active node"
# do your stuff here and set ${STAT}
# to whatever you like; 0 => ok
fi
exit ${STAT}
----------------------------
No crontabs have to be moved, nothing has to change. All you have to do is install the scripts and the appropriate crontab entry on all potential nodes and you are done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 04:56 AM
тАО07-11-2006 04:56 AM
Re: How to enable crontab for user only on active node?
Each application has its own crontab (about 5-10 applications per each host). Each application can have a crontab with about 1-50 jobs in it, so it's unfeasible to consider changing the scripts, as I also don't have control over them.
MAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 05:00 AM
тАО07-11-2006 05:00 AM
SolutionI do the latter like so for example:
# clean up old PCT data
30 5 * * * [ -d /oracle/PROD/920_64 ] && /usr/local/bin/pct.clean >/dev/null 2>&1
/oracle/PROD/920_64 does not exist on my inactive node, as /oracle/PROD is a mounted file system.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 05:18 AM
тАО07-11-2006 05:18 AM
Re: How to enable crontab for user only on active node?
When you mention thousands of scripts then this suggests an automated method of changing all the scripts. It should be rather easy to create a wrapper script that is called by cron that in turn calls your existing scripts or simply exits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2006 08:52 AM
тАО07-11-2006 08:52 AM
Re: How to enable crontab for user only on active node?
"it is your job to clean up someone else's mess."
Thanks... I'll leave this open for another couple of days and then close it, in case there are other bright suggestions floating around.
This place is always an excellent start for great ideas.
MAD