tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: v5.1+ TruCluster --- Clustercron
@ 2003-04-02 16:02 Parkin Frank - fparki
  0 siblings, 0 replies; only message in thread
From: Parkin Frank - fparki @ 2003-04-02 16:02 UTC (permalink / raw)


Original Post:

Is there a clustercron type solution for non-root cron's which does not
require a separate CAA script for each user?


Solution:

An elegant solution provided by Jason Orendorf (HP Tru64 Unix Enterprise
Team). Thanks Jason. 

Here's one simple method of implementing cluster-wide cron jobs that works
for root and non-root users alike but requires a bit of additional
administrative work for each cron job:
Create a simple script that can only succeed (return 1) on a single member
at any one time.  Something like:

		#!/bin/ksh
		set -- $(/usr/sbin/cfsmgr -F raw /)
		shift 12
		[[ "$1" = "$(/bin/hostname -s)" ]] && exit 0
		exit 1

		This script returns TRUE (0) only on the node which is CFS
serving cluster_root.  Call it "/bin/cronrun".
Add the cron entry for the new job on *all* nodes, but precede the normal
job with a check for this new script.  So if you want to run
"/usr/local/bin/runjob" daily at 5am but only once in the cluster, your new
cron entry on all nodes would be:
5 * * * /bin/cronrun && /usr/local/bin/runjob

This cron entry fires on all nodes, but the check keeps the final job
(runjob in this example) from running on all but one node.
This method nicely mixes with non-clustered cron jobs that are allowed to
run multiple times or will only run on one machine.
The drawbacks to this method are:
All cluster cron jobs that use this will all run on the CFS server for
cluster_root (which could reduce performance if you're running many,
intensive cron jobs.
Administratively, you (and your users) must create the cron entry with the
proper check ("/bin/cronrun && ") for each cluster-ized cron job.
When new members are added to the cluster, the cluster-ized cron entries
created are not propagated to the new node.



Regards
Frank 

UNIX System Administrator
Acxiom







**********************************************************************
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-02 16:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-02 16:02 SUMMARY: v5.1+ TruCluster --- Clustercron Parkin Frank - fparki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox