From owner-freebsd-hackers Sun Mar 4 14:30:45 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp02.teb1.iconnet.net (smtp02.teb1.iconnet.net [209.3.218.43]) by hub.freebsd.org (Postfix) with ESMTP id D17DE37B71A; Sun, 4 Mar 2001 14:30:39 -0800 (PST) (envelope-from babkin@bellatlantic.net) Received: from bellatlantic.net (client-151-198-135-94.nnj.dialup.bellatlantic.net [151.198.135.94]) by smtp02.teb1.iconnet.net (8.9.1/8.9.1) with ESMTP id RAA25111; Sun, 4 Mar 2001 17:30:01 -0500 (EST) Message-ID: <3AA2C1E8.85E6B318@bellatlantic.net> Date: Sun, 04 Mar 2001 17:30:00 -0500 From: Sergey Babkin X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-19990626-CURRENT i386) X-Accept-Language: en, ru MIME-Version: 1.0 To: Doug Barton Cc: Neil Blakey-Milner , Matt Dillon , John Gregor , Gerhard.Sittig@gmx.net, leifn@neland.dk, freebsd-hackers@FreeBSD.org, gjb@gbch.net, Kevin Way Subject: cron and daylight time - revisited References: <200101140244.f0E2i3518278@vieo.com> <3A621ABF.FA2C6432@bellatlantic.net> <200101142155.f0ELtLO64117@earth.backplane.com> <3A6A059C.486F6237@bellatlantic.net> <20010120235412.A42508@rapier.smartspace.co.za> <3A6B3D85.9773C9ED@bellatlantic.net> <3A6B46DF.7BE84F45@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG All, I have produced another version of the time zone changes in cron. I ran a few tests and plan to commit it to -current after a bit more testing. Everyone who wants to join the testing efforts is welcome. The comments are welcome as well. The new behavior is enabled by the option "-s", without this option the old behavior is preserved. The files are available from http://people.freebsd.org/~babkin/cron/ cron.df - context diff ct - my test crontab testdst - the test script called from this crontab dst_st.log - log of switch-over from summer time to winter time st_dst1.log - log of switch-over from winter time to summer time, with cron resterted before 1:00 st_dst2.log - log for the same switch but with cron resterted at 1:58 The logic is generally the same as in my previous attempt (see cron.8 version 1.13 in the CVS tree) with the following differences: - new option "-o" that enables the old behavior. This behavior is default now but it makes a pre-defined way to guarantee the same behavior in future in case if the default would change. - no more limitation of one-hour granularities for the time zone changes - handling of the ends ranges which fall into a disappearing time interval is more complicated. Sa can be seen from the st_dst* logs they depend on whether these jobs actually ran within one hour before the disappearing interval. So the crontab line 0 1-2 * * * /home/cron/testdst at one to two range OCLOCK as well as its equivalent 0 1,2 * * * /home/cron/testdst at one to two range OCLOCK on a switch from 2:00 ST to 3:00 DST would not normally run because it ran an hour ago, so it falls under the general ranges rule (see cron(8)) and does not run at 3:00DST (which is the same as 2:00ST). But if cron was restarted or crontab reloaded between 1:00 and 2:00 then this knowledge would be lost and the command would be executed at 3:00DST as well. I don't quite like that but I see no easy and efficient way to check if some command would have run within an hour before its next scheduled run. This time is a fixed hour rather than the difference in offset from GMT because all the commands in cron run by hours (possibly, at multiple minute values, but all the minute values repeat for all the listed hour values). -SB To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message