Bug 24494

Summary: daylight time change support in cron
Product: Base System Reporter: babkin <babkin>
Component: binAssignee: babkin <babkin>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description babkin freebsd_committer freebsd_triage 2001-01-20 20:40:01 UTC
Cron may skip or repeat the jobs falling into the interval that gets missing
or duplicated during the time change to daylight saving or back. I'll commit
my change directly to -current, here is description and test example
for tracking purposes:

Now the jobs run as intuitively expected. If a job falls
into time interval that disappears during switch from
standard time (ST) to daylight saving time (DST) or is
duplicated during the reverse switch, then it's handled
in one of 2 ways. The jobs that run every hour work
as before, they skip the skipped hour or run in the added
hour as usual. But the jobs that run less frequently
are executed exactly once, they are not skipped nor
executed twice (unless cron is restarted or the user's
crontab is changed during such a time interval). 

Test crontab:

0 1 * * * /home/guest/testdst at one OCLOCK
0 0-1 * * * /home/guest/testdst at zero to one range OCLOCK
0 2 * * * /home/guest/testdst at two OCLOCK
0 1-2 * * * /home/guest/testdst at one to two range OCLOCK
0 3 * * * /home/guest/testdst at three OCLOCK
1 1 * * * /home/guest/testdst at one
1 0-1 * * * /home/guest/testdst at zero to one range
1 2 * * * /home/guest/testdst at two
1 1-2 * * * /home/guest/testdst at one to two range
1 3 * * * /home/guest/testdst at three

test script testdst:

#!/bin/sh
date "+%D %T %Z testdst $* " >> /home/guest/dst.log

(trace excerpt starts at 1:55 EST)
04/02/00 03:00:00 EDT testdst at two OCLOCK 
04/02/00 03:00:00 EDT testdst at three OCLOCK 
04/02/00 03:01:01 EDT testdst at two 
04/02/00 03:01:01 EDT testdst at three 
(trace excerpt ends at 3:05 EDT)

(trace excerpt starts at 0:55 EDT)
10/29/00 01:00:00 EDT testdst at zero to one range OCLOCK 
10/29/00 01:00:00 EDT testdst at one OCLOCK 
10/29/00 01:00:01 EDT testdst at one to two range OCLOCK 
10/29/00 01:01:00 EDT testdst at zero to one range 
10/29/00 01:01:00 EDT testdst at one 
10/29/00 01:01:00 EDT testdst at one to two range 
10/29/00 01:00:00 EST testdst at zero to one range OCLOCK 
10/29/00 01:00:00 EST testdst at one to two range OCLOCK 
10/29/00 01:01:00 EST testdst at zero to one range 
10/29/00 01:01:00 EST testdst at one to two range 
10/29/00 02:00:00 EST testdst at one to two range OCLOCK 
10/29/00 02:00:00 EST testdst at two OCLOCK 
10/29/00 02:01:02 EST testdst at two 
10/29/00 02:01:02 EST testdst at one to two range 
10/29/00 03:00:00 EST testdst at three OCLOCK 
10/29/00 03:01:00 EST testdst at three 
(trace excerpt ends at 3:05 EST)

Fix: 

will commit to -current
Comment 1 babkin freebsd_committer freebsd_triage 2001-01-20 21:30:43 UTC
State Changed
From-To: open->closed

Committed the changes to -current. 


Comment 2 babkin freebsd_committer freebsd_triage 2001-01-20 21:30:43 UTC
Responsible Changed
From-To: freebsd-bugs->babkin

Assigned PR to myself as I did the commit in CVS. 
.