SUMMARY: How to run a GMT cron?

From: David Mostardi (
Date: Wed Nov 02 1994 - 11:35:55 CST

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.


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 Webb) (Birger A. Wathne) (Perry Hutchison) (Glenn Satchell)
Dave Mitchell <> (Dr Gareth Barker) (Jochen Bern)
"B C Hamshere" <> (Dan Lorenzini) (Tim Evans)
David.Miner@East.Sun.COM (Dave Miner)
brobbins@Newbridge.COM (Bert Robbins) (Andy Feldt) (Scott Blachowicz)

David Mostardi Email:
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 files, all different."

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


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

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