Cron during British Summer Time / Daylight Saving Time

For older versions of unix/linux, crons running at 01.* (anything from 01:00 to 01:59) do not run during the Spring Sunday time change. Those sames crons will run twice during the Autumn time change.

So it is important to not use 01.* times in your cron entries, for anything which runs on a Sunday.

Newer versions of unix try to deal intelligently with the time change. They attempt to run the Spring 01.* crons at a suitable time after 2am, and make sure not to run Autumn 01.* crons twice.

You can see what the behaviour of your version of unix is by looking at ‘man cron’ and ‘man crontab’. If they contain information like the below, then they attempt to deal intelligently with time changes, if not, not.  The below is from ‘man cron’ in current HP-UX:

Spring and Autumn Time Transitions

On the days of daylight savings (summer) time transition (in time zones and countries where daylight savings time applies), cron schedules commands differently from normal.

In the following description, an ambiguous time refers to an hour and minute that occurs twice in the same day because of a daylight savings time transition (usually on a day during the Autumn season).  A nonexistent time refers to an hour and minute that does not occur because of a daylight savings time transition (usually on a day during the Spring season).  DST-shift refers to the offset that is applied to standard time to result in daylight savings time.  This is normally one hour, but can be any combination of hours and minutes up to 23 hours and 59 minutes (see tztab(4)).

When a command is specified to run at an ambiguous time, the command is executed only once at the first occurrence of the ambiguous time.

When a command is specified to run at a nonexistent time, the command is executed after the specified time by an amount of time equal to the DST-shift.  When such an adjustment would conflict with another time specified to run the command, the command is run only once rather than running the command twice at the same time.

Commands that are scheduled to run during all hours (there is a * is in the hour field of the crontab entry) are scheduled without any adjustment.

Britain, and the rest of Europe, always switch 1-2am, but other countries, including parts of the US, can switch at different times, so you may need to watch a different time range there.

April 6, 2011

Leave a Reply

Your email address will not be published. Required fields are marked *