1832750 Members
3415 Online
110045 Solutions
New Discussion

Cron and clusterservices

 
SOLVED
Go to solution
Richard Molenkamp_1
Occasional Contributor

Cron and clusterservices

If you have an HP-UX cluster and want the cron to be fail-over proof create an cronfile which is identical on all systems and put an if-statement in every line to check if this line should be executed on this particular system. You could distribute the cronfile using rdist.

# Run myscript if clusterpackage dcc runs on this system (directory /dcc/dcc exists)
10 7-20 * * * [ -d /dcc/dcc ] && /dcc/dcc/scripts/myscript.sh >/dev/null


# Synchronize files from hpux1 naar other systems
30 0 * * * [ "`uname -n`" = "hpux1" ] && /usr/bin/rdist -y -q -f /etc/rdist.cfg

## This is my first contribution to the newsgroup ##
1 REPLY 1
Geoff Wild
Honored Contributor
Solution

Re: Cron and clusterservices

Very nice work...but I would also redirect stnd err and out:

10 7-20 * * * [ -d /dcc/dcc ] && /dcc/dcc/scripts/myscript.sh >/dev/null 2>&1

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.