Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Time-change behavior for cron(8)



On Sat, 27 Sep 2014, Christos Zoulas wrote:

In article <Pine.NEB.4.64.1409280629180.18862%vps1.whooppee.com@localhost>,
Paul Goyette  <paul%whooppee.com@localhost> wrote:
The man page for cron(8) says

	Daylight Saving Time and other time changes

	     ...

	     Time changes of more than 3 hours are considered to be
	     corrections to the clock or timezone, and the new time
	     is used immediately.


However this does not seem to be working.  I've recently updated my
machine's time-zone from US/Pacific to Asia/Manila.  Yet my daily(5)
continues to run based on the original time-zone.  The zone change
amounts to a 15-hour difference, certainly enough to trigger the above
3-hour rule.

I don't think that this sentence is worded properly. It means changes
to system time (the clock), not timezone. In FEATURES:

It's very confusing, especially since the elided text dealing with changes to/from "summer time" do not affect "the clock" yet special pains are taken to avoid missing or duplicating activities.

	 TZ can be set, but cron ignores it other than passing
	 it on through to the commands it runs.

Yes setting TZ within the crontab itself has that effect.

But setting CRON_TZ _does_ affect cron(8)'s interpretation of the time/date fields in subsequent job lines. So it would imply that the current time-zone (or CRON_TZ if defined) should affect scheduling of jobs, and thus changes to time-zone should cause jobs to reschedule.

As written, the man page strongly implies that the jobs are scheduled based on local/apparent/displayed time (and NOT based on system clock time), and changes to timezone should be observed whther the changes are made via CRON_TZ or by changes to /etc/localtime.

In order to get the schedule to sync-up with the new zone, I had to
kill(1) and then restart cron.

Right...

It might be nice to have a 'kill -HUP' option to effect a restart ore easily?


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index