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

Fwd: Re: cron in UTC?



Sorry, sent to steve instead of list by mistake


-------- Original Message --------
Subject: Re: cron in UTC?
Date: Mon, 29 Sep 2014 16:18:35 +0100
From: Tony van der Hoff <tony@vanderhoff.org>
To: Steve Litt <slitt@troubleshooters.com>

> On Wed, 24 Sep 2014 11:54:57 +0100
> Tony van der Hoff <tony@vanderhoff.org> wrote:
> 
>> Greetings,
>>
>> 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?
> 

Thanks to both correspondents who replied. Sorry for my tardy response,
but I was called away for a few days.

On 24/09/14 16:01, Don Armstrong wrote:

> 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).
>
well, it's my understanding that the system (hardware)  time is always
UTC, but there is no way to set localtime to GMT (or UTC). Perhaps I'm
misunderstanding you.

My problem is that cron works to localtime. I want my cron tasks to be
triggered at the same time (UTC) each day, regardless of the current
localtime, wherever I may be.

> Otherwise, you'll have to provide TZ to cron, presumably in
> /etc/default/cron or similar...

That would be nice, but there does not appear to be any way to do that.

On 24/09/14 17:44, Steve Litt wrote:

> LOL, I don't recommend this. I *really* don't recommend this. But you
> *could* hack my homegrown cron to measure the difference between local
> time and UTC and do whatever you want done.
> 
LOL? OK, a laughing matter, perhaps. What's funny about it, and Why
don't you recommend this?
> 
> HTH, sure it doesn't :-)
Not much, THANKS.

> 
> SteveT
> 
> Steve Litt                *  http://www.troubleshooters.com/
> Troubleshooting Training  *  Human Performance
> 
> 


-- 
Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |



Reply to: