I work with Christopher, and today we failed over our test system using the crontab syncronization scripts mentioned above. Everything appeared to work great. The only complaint that I have is that on our system (AIX 6.1), when we load crontab from a file, we lose all the blank lines that help separate and format our different cron jobs.
One change that I have since made to this process is to have the inactive crontab entry make a copy before loading the active crontab. This should provide us with some information about the state of the crontabs whenever failover occurs.
So, with all that being said, here is the inactive crontab that we now have:
# This is the inactive version of a crontab that is loaded on
# the inactive node of the Cloverleaf cluster.
# DO NOT DELETE THIS CRON ENTRY OR FILE!!!!!!
# If the active crontab is available (and thus this node is active), load the active crontab.
* * * * * test -f /clovermisc/cronsync/crontab.active && cp -p /clovermisc/cronsync/crontab.active /clovermisc/cronsync/crontab.loaded.$(date “+%Y%m%d%H%M%S”) && crontab /clovermisc/cronsync/crontab.active
And here is the important pieces of the active crontab:
#########################################
# Crontab syncing b/w cluster nodes
#########################################
# Load the inactive crontab if the active crontab can’t be found
* * * * * test -f /clovermisc/cronsync/crontab.active || crontab ~/crontab.inactive
# Dump the active crontab in case of change
* * * * * test -d /clovermisc/cronsync && crontab -l > /clovermisc/cronsync/crontab.active
As you see, we dump the currently active crontab. This eliminates the need for any “unusual” steps to update the crontab. We can just run “crontab -e” to edit; then on failover, the changes are “just there”.
Thanks,
Eric