How can I make cron jobs run on GMT, not local time?
this is my crontab file:
#m h d m wday command
TZ=GMT
5 0,6,12,18 * * * ~/Documents/bash/transfer.sh
my jobs seem to be running at the local time (GMT+11)
I am running os x snow leopard, but will move the code onto linux when development is complete.
The linux environment may be a shared environment where I may has less control over configuration.
Best Answer
Not all versions of
cron
support running jobs using a time zone other than the system's.If yours does, it's likely that the specification should be
TZ=GMT
orTZ=UTC
(without the angle brackets). In some cases, the variable would beCRON_TZ
.The best thing to do is check the documentation specific to the particular system. See
man 5 crontab
.