- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Syncing Crontab in a Service Guard Environment
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
Forums
Discussions
Discussions
Discussions
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
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
03-23-2004 08:35 AM
03-23-2004 08:35 AM
Syncing Crontab in a Service Guard Environment
How do you go about keeping crontab between both systems in sync?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:40 AM
03-23-2004 08:40 AM
Re: Syncing Crontab in a Service Guard Environment
TDIR=${TMPDIR:-/var/tmp}
TFILE=${TDIR}/X${$}.cron
remsh hostB crontab -l > ${TFILE}
crontab < ${TFILE}
rm -f ${TFILE}
Add a bit of error checking and that's it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:45 AM
03-23-2004 08:45 AM
Re: Syncing Crontab in a Service Guard Environment
if [ $(hostname) != "server2" ]
then
for USER in $(cat /tmp/crontablist)
do
rcp /var/spool/cron/crontabs/$USER server2:/tmp/${USER}_cron
remsh server2 "su ${USER} -c "/usr/bin/crontab /tmp/${USER}_cron"
remsh server2 rm /tmp/${USER}_cron
done
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:49 AM
03-23-2004 08:49 AM
Re: Syncing Crontab in a Service Guard Environment
You could rcp the files over and then send a kill -1 to cron.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:55 AM
03-23-2004 08:55 AM
Re: Syncing Crontab in a Service Guard Environment
In our environment, instead of sync'ing crontabs, we made separate crontabs for different users. So, as the package goes up, the correspondent crontab is putting to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:56 AM
03-23-2004 08:56 AM
Re: Syncing Crontab in a Service Guard Environment
What about the following ?
To set node1 as a master and to run
#!/usr/bin/sh
LIST_USERS="root admin whatever"
for USER in $LIST_USERS ; do
rcp /var/spool/cron/crontabs/$USER node2:/var/spool/cron/crontabs/.
done
remsh node2 "/sbin/init.d/cron stop"
remsh node2 "/sbin/init.d/cron start"
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:04 AM
03-23-2004 09:04 AM
Re: Syncing Crontab in a Service Guard Environment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:11 AM
03-23-2004 09:11 AM
Re: Syncing Crontab in a Service Guard Environment
thats one way to HUP cron. assuming you don't have any other process that match cron as the grep pattern.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 08:47 PM
03-23-2004 08:47 PM
Re: Syncing Crontab in a Service Guard Environment
1. Create a crontab file on shared storage associated with the package.
2. in the package start scripts update the crontab with this file
3. in the package stop scripts remove the crontab
4. As sometimes the node will fail while the package is running, we also need a startup script in /sbin/init.d linked to /sbin/rc2.d that runs before the cluster starts and removes all crontabs associated with packages (when the package starts, they will get added back)
5. Make sure that there is a comment at the start of the crontab that reads something like:
# WARNING: Do not update using crontab -e
# Instead, update file /shareddisk/myuser/crontab and run
# crontab /shareddisk/myuser/crontab
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:20 PM
03-23-2004 10:20 PM
Re: Syncing Crontab in a Service Guard Environment
Regards,
Trond