From nobody@FreeBSD.org  Sat Jan 20 12:39:59 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 2766637B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Jan 2001 12:39:59 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f0KKdxq32408;
	Sat, 20 Jan 2001 12:39:59 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200101202039.f0KKdxq32408@freefall.freebsd.org>
Date: Sat, 20 Jan 2001 12:39:59 -0800 (PST)
From: babkin@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: daylight time change support in cron
X-Send-Pr-Version: www-1.0

>Number:         24494
>Category:       bin
>Synopsis:       daylight time change support in cron
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    babkin
>State:          closed
>Quarter:        
>Keywords:       cron daylight
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 20 12:40:01 PST 2001
>Closed-Date:    Sat Jan 20 13:30:43 PST 2001
>Last-Modified:  Sat Jan 20 13:34:50 PST 2001
>Originator:     Sergey Babkin
>Release:        5.0-current
>Organization:
>Environment:
>Description:
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)


>How-To-Repeat:

>Fix:
will commit to -current

>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed 
State-Changed-By: babkin 
State-Changed-When: Sat Jan 20 13:30:43 PST 2001 
State-Changed-Why:  
Committed the changes to -current. 


Responsible-Changed-From-To: freebsd-bugs->babkin 
Responsible-Changed-By: babkin 
Responsible-Changed-When: Sat Jan 20 13:30:43 PST 2001 
Responsible-Changed-Why:  
Assigned PR to myself as I did the commit in CVS. 
. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24494 
>Unformatted:
