O/H Yan Seiner έγραψε:
I am trying to figure out how to set up a failover system that runs apps
from crontab.

In my current setup, the server starts a cron job every 2 hours that
reaches out to my clients and pulls data.  This must be a server-pull;
there is no way to set it up as a client-push.  The data that's pulled
will be replicated using rsync, coda, etc to the backup server.  (I have
not gotten that far yet.)

I'd like to set this up as a failover system.  Apache sounds easy, but how
do I failover a cron job?

Also, is it possible to have the two servers in different geographic
locations?  Ie. to do the failover to another server, in another country?

--Yan

Facing a similar situation, I created a separate crontab.in for the user i wanted (mailman) and this simple script:
---snip---
#! /bin/sh
#
# Get functions
. /etc/init.d/functions

# See how we were called.
case "$1" in
start)
echo -n "Setting up mailman crontab..."
/usr/bin/crontab -u mailman /opt/shared/var/mailman/cron/crontab.in
echo
;;
stop)
echo -n "Removing mailman crontab"
/usr/bin/crontab -u mailman -r
echo
;;
status)
[ `/usr/bin/crontab -u mailman -l 2>&1 | grep -c qrunner` -gt 0 ] && echo -n "mailman running" || echo -n "mailman stopped"
#removed (heartbeat doesn't like it)
#/usr/bin/crontab -u mailman -l
echo
;;
*)
echo "Usage $0 (start|stop|status)"
;;
esac

exit 0
---snip---

Hope it helps.

Thanos Chatziathanassiou

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to