Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 1998 08:03:22 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        archie@whistle.com (Archie Cobbs)
Cc:        gsutter@pobox.com, hackers@FreeBSD.ORG
Subject:   Re: Daylight Savings Time - bug
Message-ID:  <199804070803.BAA25988@usr09.primenet.com>
In-Reply-To: <199804070538.WAA22606@bubba.whistle.com> from "Archie Cobbs" at Apr 6, 98 10:38:05 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I think it only runs once. In other words, it can be designed
> to work "correctly" in the fall or in the spring, but not both.
> This is because "correct" is a matter of policy, not true
> correctness.
> 
> Some cron entries are "meant" to run once every day (month,
> hour, whatever) e.g. /etc/daily. Others are meant to run once,
> at the specified time (e.g., on April 15, remind me that my
> taxes are due). Which behavior you choose makes one of these
> types work but not the other.
> 
> I agree that /etc/daily and friends should be scheduled to
> run at some time other than between 2am and 3am.

The typical way this is handled is to advance the clock through
all intermediate jobs as if every second of the hour had actually
taken place.

This won't work if you have two jobs, one of which depends on the
output of the other, but of course order dependencies on program
executions are why Mr. Bourne invented shell scripts.  8-).

I think you could advance the clock fairly easily, or chock the
clock in the "fall back" case, by waking up frequently enough
that an hour of drift is not a likely (or feasible) occurance.

You save the clock each time you wake up, after comparing it.

You would "see" the one hour change, and you would "drift through"
intermediate times until the everything in the zone had been executed.

For the "fall back", you put a chock (a wedge shaped piece of
wood or other material to keep wheels from rolling) in the clock
until the clock is greater than or equal to the saved clock.

How does cron deal with time adjustments?  If the answer is "not at
all", that's rather piss-poor.  8-(.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804070803.BAA25988>