TIMEZONE - INTERPRETATION BY CRON

How does a CRON job refer to the timezone when starting to execute it?  

Say, I am in San Francisco (my timezone is PST).  I schedule a cron job to run at 01:35 AM everyday. On October 26 (the day on which PST becomes the effective taking into consideration day light savings switch), how many times does my cron job run on that specific day?  

In other words, how does cron determine the timezone according to which it needs to run scheduled jobs?
nsarathcAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Nisus091197Connect With a Mentor Commented:
Hi,

The system default timezone is defined by the TZ variable in the /etc/default/init file.  For backward compatibility /etc/TIMEZONE is a symlink to it.

The PST timezone does not adjust for daylight savings, you would need to use the PDT timezone.

The number of times the cronjob will run will depend on the timezone of your system and the exact time that the change will take place.

If your timezone is PST, the cron job will run once.  If you change it to PDT and the system clock changes between 01:35 and 02:35 then I imagine it will run twice.

It would be easy to verify.  Just use the date command to set the time to 01:30 on Oct. 26 and see what happens.  Try again with TZ=PDT in your /etc/default/init (don't forget to reboot).

Regards, Nisus
http://www.omnimodo.com
0
 
dmaloy1Commented:
Through the definition in the /etc/default/init file.
0
 
liddlerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by Nisus

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0
All Courses

From novice to tech pro — start learning today.