Shared cron jobs

Dan Brown danb at zu.com
Fri May 12 20:54:14 BST 2006


My pair of LVS servers share the same database.  I have a couple of sites
which import data daily from other sites, or via uploaded files.  I do not
want the servers to both be running the same job at the same time obviously
so I'd like to swap out crontab files when the backup director takes over.

As it happens this should be relatively easy since it's a two server setup
using Ultramonkey with both the httpd services and the ldirector processes
on the same server.  I don't have to deal with X number of extra possible
servers.  
However I'm not entirely sure where a _good_ place to put it would be.  It
seems that putting it in the /etc/init.d/ldirector script might work,
something like:

case "$1" in
  start)
        action "Starting ldirectord" $DAEMON start
        if [ $? -eq 0 ]; then
          cp -f /etc/crontab.ldirector-running /etc/crontab
        fi
        ;;
  stop)
        action "Stopping ldirectord" $DAEMON stop
        if [ $? -eq 0 ]; then
          cp -f /etc/crontab.ldirector-stopped /etc/crontab
        fi
        ;;
  ...
esac


What do you suggest?

_________________________________
Dan Brown
zu.com communications inc.       



Search lvs-users Archives
Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort

More information about the lvs-users mailing list