Shell Cron – Change the Time Zone of a Cronjob

cronshelltimezone

I have a cronjob which is executes every day at 9:00 AM of UTC-Time. I'm in GMT+1 so it executes at 10:00 AM local time. When there is the timezone change (to daylight saving time, DST), the cronjob executes still at 9:00 AM of UTC-Time but at 11:00 AM local time. But I want it always to execute at 10:00, no matter of summer time or not. How do I do that?

Best Answer

Check your setting in /etc/timezone. In the question you mentioned you are in "GMT+1", if that is what your timezone is set to, your script will always execute at UTC plus one hour. If you set it to e.g. "Europe/Paris", the time of execution will change with the daylight savings time.

Related Question