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

Re: cron in UTC?



On Wed, 24 Sep 2014, Tony van der Hoff wrote:
> I carry my wheezy laptop over various timezones, and my VPS with which
> it communicates is on the Europe/London zone, which uses DST.
> 
> The result of this is that cron tasks, which are triggered by
> localtime become unsynchronised, and only by arranging the task times
> very carefully can I ensure that they're run in the right order across
> hosts. This is not very satisfactory.
> 
> It occurs to me that Cron should have a config option to select the
> timezone in which it operates, regardless of the the localtime
> setting. Searching around, this doesn't seem to exist.
> 
> An alternative, found by googling, appears to be to wrap cron in a
> script, satting TZ=UTC. I guess this would not be update-proof.
> 
> Has anyone here found any other solutions, or have any suggestions,
> please?

My #1 suggestion is to have system time be GMT, and every shell/user set
TZ appropriately. That's basically the only sane setting, as many time
zones do DST (and change the rules for it from time to time).

Otherwise, you'll have to provide TZ to cron, presumably in
/etc/default/cron or similar... but that will also cause problems if
anyone else assumes that cron is in a different timezone.

-- 
Don Armstrong                      http://www.donarmstrong.com

Who is thinking this?
I am.
 -- Greg Egan _Diaspora_ p38


Reply to: