SUMMARY: How to run a GMT cron?

From: David Mostardi (david@capmkt.com)
Date: Wed Nov 02 1994 - 11:35:55 CST


ORIGINAL QUESTION:
------------------
I have a daily cron job which needs to run
at midnight Greenwich Mean Time. The problem:
in California "midnight GMT" is 5pm during
daylight time, but 4pm during standard time.
I want a mechanism which is sensitive to the
time changes.

SOLUTION:
----------

Most responders agreed on this approach:

   Wrap the cron in a script which tests for GMT (using 'date -u')
   and have it sleep an hour (or reschedule itself with 'at')
   if necessary.

   Alternatively, run *two* crons, both of which check 'date -u',
   and only run the cron which tests positively for midnight GMT.
   Jochen Bern wins the Brevity Prize with this crontab line:

        0 4,5 * * * [ `date -u +\%H` -eq 0 ] && your_prog

   The %-sign must be escaped with a "\", or crontab will
   interpret it as a "newline" character.

Thanks to:
Mike Raffety <mike_raffety@il.us.swissbank.com>
mwebb@erin.gov.au (Mike Webb)
Birger.Wathne@vest.sdata.no (Birger A. Wathne)
perryh@pluto.rain.com (Perry Hutchison)
Glenn.Satchell@uniq.com.au (Glenn Satchell)
Dave Mitchell <D.Mitchell@dcs.shef.ac.uk>
gareth@nmr.ion.bpmf.ac.uk (Dr Gareth Barker)
bern@penthesilea.uni-trier.de (Jochen Bern)
"B C Hamshere" <B.C.Hamshere@newcastle.ac.uk>
dal@gcm.com (Dan Lorenzini)
tkevans@eplrx7.es.duPont.com (Tim Evans)
David.Miner@East.Sun.COM (Dave Miner)
brobbins@Newbridge.COM (Bert Robbins)
Andy_Feldt@phyast.nhn.uoknor.edu (Andy Feldt)
scott@statsci.com (Scott Blachowicz)

Regards,
-------------------------------------------------------------------
David Mostardi Email: david@capmkt.com
Network & Systems Administrator Phone: (510) 540-6400
Capital Market Technology, Inc. FAX: (510) 540-5505
1995 University Ave. #390, Berkeley CA 94704

  "You are in a twisty maze of sendmail.cf files, all different."

----- End Included Message -----

--JAA05227.783797722/slag.capmkt.com--

----- End Included Message -----



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:13 CDT