From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Parkin Frank - fparki Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: v5.1+ TruCluster --- Clustercron Date: Wed, 02 Apr 2003 17:02:59 +0100 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1049299311 27593 80.91.224.249 (2 Apr 2003 16:01:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 2 Apr 2003 16:01:51 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Apr 02 18:01:49 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 190kgP-0007Aa-00 for ; Wed, 02 Apr 2003 18:01:49 +0200 Original-Received: (qmail 490 invoked by uid 5); 2 Apr 2003 16:01:56 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 481 invoked by uid 49493); 2 Apr 2003 16:01:56 -0000 Original-Received: from fparki@acxiom.co.uk by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-1.7/5.0):. Processed in 0.469057 secs); 02 Apr 2003 16:01:56 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 2 Apr 2003 16:01:56 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCQ001U94IB7O@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 02 Apr 2003 11:01:53 -0500 (EST) Original-Received: from crichton.acxiom.com ([198.160.100.120]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCQ00K5Z4H4H0@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 02 Apr 2003 11:00:43 -0500 (EST) Original-Received: from relay2.conway.acxiom.com (unverified) by crichton.acxiom.com (Content Technologies SMTPRS 4.3.6) with ESMTP id for ; Wed, 02 Apr 2003 10:00:34 -0600 Original-Received: from srvlon20.uk.acxiom.com (unverified) by relay2.conway.acxiom.com (Content Technologies SMTPRS 4.2.10) with ESMTP id for ; Wed, 02 Apr 2003 10:00:33 -0600 Original-Received: by srvlon20.uk.acxiom.com with Internet Mail Service (5.5.2653.19) id <2CJ2Y32V>; Wed, 02 Apr 2003 16:53:59 +0100 Content-return: allowed Original-To: "'tru64-unix-managers@ornl.gov'" X-Mailer: Internet Mail Service (5.5.2653.19) Xref: main.gmane.org gmane.os.tru64.managers:3868 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3868 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.