How are cron jobs affected when a Daylight Savings change occurs
Environment
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
Issue
- Need to verify that system
cron
job scripts will run as expected when Daylight Savings time moves forward and falls back
Resolution
cron
is aware of Daylight Savings Time changes and adjusts as needed to ensure the job runs a single instance
# man 8 cron
Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused by the Daylight Saving Time changes, are handled in a spe‐
cial way. This only applies to jobs that run at a specific time and jobs that run with a granularity greater than one hour.
Jobs that run more frequently are scheduled normally.
If time was adjusted one hour forward, those jobs that would have run in the interval that has been skipped will be run
immediately. Conversely, if time was adjusted backward, running the same job twice is avoided.
Time changes of more than 3 hours are considered to be corrections to the clock or the timezone, and the new time is used
immediately.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments