Cron – Where does Cron checks the time zone on Debian

crontimezone

I have seen number of topics that are related to my question, but non of them answers it.

Where does Cron look-up the time zone ?

root@awesome:~# date
Fri Feb 17 14:02:02 EET 2012

root@awesome:~# hwclock -r
Fri 17 Feb 2012 14:03:39 EET  -0.815689 seconds

But the Cron still works on GMT zone. (I have to make every cron job +2h to make it run properly on time)

Is there mistakes in time-zone configuration ? Or there are more time-zone configuration on Debian Linux, and I am configurationg in on the wrong one ? (I have configured my time zone via tzselect

Best Answer

You have to restart the cron daemon for the time zone change to take effect.

Ref: http://wiki.debian.org/TimeZoneChanges

Direct quote from the above link...

Restarting Daemons and Long-Running Programs

After the zoneinfo files are updated, you may need to restart daemons and other long-running programs to get them to use the new zone information. Examples of such programs include apache, bind, cron, fetchmail -d, inetd, mailman, sendmail, and sysklogd. A common symptom of this problem is seeing incorrect timestamps mixed in with the correct timestamps in your log files (e.g. /var/log/syslog). Even interactive programs like "mutt" may continue to use the old timezone information until they are restarted.

Related Topic