LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cronjob daylight saving best way (https://www.linuxquestions.org/questions/linux-newbie-8/cronjob-daylight-saving-best-way-939296/)

setcookie 04-11-2012 10:43 AM

Cronjob daylight saving best way
 
Hello, this is my first post and being a linux system admin newbie my question is too much to be answered without your help.

On a Debian Linux Server i have cronjobs running every day between 1 AM - 4 AM. They have to run always on the same time. Because of the daylight saving issue when changing from summertime to wintertime i would need to change the crontab entries manually which sucks.

Here are my timezone settings:

/etc/localtime Sun Mar 27 00:59:59 2011 UTC = Sun Mar 27 01:59:59 2011 CET isdst=0 gmtoff=3600
/etc/localtime Sun Mar 27 01:00:00 2011 UTC = Sun Mar 27 03:00:00 2011 CEST isdst=1 gmtoff=7200
/etc/localtime Sun Oct 30 00:59:59 2011 UTC = Sun Oct 30 02:59:59 2011 CEST isdst=1 gmtoff=7200
/etc/localtime Sun Oct 30 01:00:00 2011 UTC = Sun Oct 30 02:00:00 2011 CET isdst=0 gmtoff=3600

The question what is the best solution to have the system take care of the daylight saving issue:

1) using fcron?
2) using ntpd for clock syncronisation
3) ?

The options are basically things i have read - not that i really know how to implement them.

anybody any suggestions or tips?

thanks

set*

MensaWater 04-11-2012 11:00 AM

Vixie cron (which is what is used in Linux) as well as most UNIX cron implementations address daylight time changes automatically. If you type "man cron" you can see details such as:

Quote:

Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused by
the start or end of Daylight Saving Time, are handled specially. This only applies to jobs that run at a specific time and jobs that are run with a granularity greater than one hour. Jobs that run more frequently are scheduled normally.
If time has moved forward, those jobs that would have run in the interval that has been skipped will be run immediately. Conversely, if timehas moved backward, care is taken to avoid running jobs twice.

Time changes of more than 3 hours are considered to be corrections to the clock or timezone, and the new time is used immediately.
That is to say you don't have to adjust for time changes because it will still run things in the order you have in cron even if the apparent time is different.

setcookie 04-12-2012 03:35 AM

i dont see any how-to, documentation, installation advice whatsoever for vixie cron. As i understand it it runs on top of the cron scheduler so all commands stay the same but how to install it?

ah ok the cron installed is already the vixie cron implementation so i shouldnt care about daylight savings right?

linuxlover.chaitanya 04-12-2012 05:34 AM

Yes as per the man command, cron should automatically take care of the DST changes to the system.

MensaWater 04-12-2012 07:54 AM

Quote:

Originally Posted by setcookie (Post 4650840)
i dont see any how-to, documentation, installation advice whatsoever for vixie cron. As i understand it it runs on top of the cron scheduler so all commands stay the same but how to install it?

ah ok the cron installed is already the vixie cron implementation so i shouldnt care about daylight savings right?

Correct. If you type "man cron" you'll see the credit for Paul Vixie at the bottom of the man page.


All times are GMT -5. The time now is 11:08 PM.