On Wed, 2008-12-03 at 21:23 +0000, Todd, Conor (PDX) wrote:

>  I can't do this using a crontab because one never knows which host 
> will be running the SVN service (and have the disks mounted for it). 


>  Has anyone else tackled this issue yet?

You may not know in advance whether a given host is the master, but you
can check at run time. I do this and it works fine; I have a variety of
cron jobs on several different heartbeat/DRBD clusters that I want to
run only on the master, so just check for the presence of something that
will only be there when the shared storage area is mounted:

* * * * [ -d /rep/mysql ] && cron-script

This is when the DRBD shared disk is mounted as /rep, and /var/lib/mysql
is a symlink to /rep/mysql for a MySQL service. The condition is true
only when that host is the master, so cron-script only runs on the
master. Kludgy but simple; works for me.

--Greg


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to