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

Re: Fwd: Re: cron in UTC?



On Mon, 29 Sep 2014, Tony van der Hoff wrote:
> > On Wed, 24 Sep 2014 11:54:57 +0100
> 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.

There are two different clocks here; there's the system clock which is
kept by the kernel, which can be in any timezone, and the hardware clock
which is kept by the motherboard, which is typically in UTC on unix
machines.

To switch the system time, just run

dpkg-reconfigure tzdata; # as root

and then select None, then UTC. Voila, your system time is now in UTC.

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

There actually is; you edit /etc/pam.d/cron and add a line like

session       required   pam_env.so envfile=/etc/default/cron_locale

and add a /etc/default/cron/locale with TZ="UTC".

But that's complicated.

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

"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot


Reply to: