Timing Cron Jobs Appropriately
Most sysadmins wisely set daily maintenance cron jobs to take place overnight, so as not to affect server performance during peak hours. However, you should never set a cronjob to run at 01:00 or 02:00 in the morning.In the spring, when Daylight Saving Time commences, the clock will jump from 01:59:59 to 03:00:00. The 2AM hour is skipped entirely, so cron jobs set for 02:00:00 - 02:59:59 may not execute.In the fall, when Daylight Saving Time ends, the clock will jump from 01:59:59 to 01:00:00. This means that on this day, the entire 1AM hour actually happens twice. Cron jobs set to run at 1 in the morning, or some minute during that hour, stand a chance of being doubly executed.Some operating systems, and some implementations of cron, will attempt to work around these timing idiosynchrasies. Don't bet on it, though. Set your off-peak cron jobs to run at 3AM. 03:00:00 happens - and happens only once - on both the "spring forward" and the "fall back" days, as well as every other day of the year.
About the Author
Marvin H. Fowler is a technology analyst for Drunkwerks. He enjoys writing articles about technology aimed at other industry professionals.
Tell others about
this page:
Comments? Questions? Email Here