LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Shared cron jobs

To: "'LinuxVirtualServer.org users mailing list.'" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Shared cron jobs
From: "Dan Brown" <danb@xxxxxx>
Date: Fri, 12 May 2006 13:54:14 -0600
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.       



<Prev in Thread] Current Thread [Next in Thread>