Hello all, A friend (who is by no means a Linux expert and lives at the other end of the world) is using an Archlinux system that has its date and time completely wrong - the year is 2019. Is using timedatectl set-time a safe way to fix this ? In other words, would a system time jump cause problems ? In the hwclock manpage there is a warning that -s (which also causes the system time to jump) should not be used on a running system, this is why I ask. The alternative would be to set the HW clock in the BIOS. If I understand things correctly, the new system time will then be set when booting. TNX, -- FA
On Fri, 2023-01-27 at 12:39 +0100, Fons Adriaensen wrote:
Is using timedatectl set-time a safe way to fix this ? In other words, would a system time jump cause problems ?
Hi, it depends. However, I'm still using an acient script running ntpdate 0.de.pool.ntp.org && hwclock --set --date "$(date "+%a %b %d %Y %r")" on a desktop PC and never experienced an issue. As long as the clock is only advanced or, as in my case, sometimes put back a few seconds, I don't see any risks. As far as I know, it's only risky if you set the clock back a long time and then, for example, sync files. Regards, Ralf
Fons - as you noted you have a bug time delta to square away - I'd boot to single user and set the clock to be about right - then set hardware clock. I would do something like : date -s 'xxx' or as you suggested timedatectl --set-time 'xxx' then hwclock --systohc --utc After reboot - to keep clock correct then setup chrony (or one of the other time sync alternatives such as systemd-timesyncd or ntpd). best gene
participants (3)
-
Fons Adriaensen
-
Genes Lists
-
Ralf Mardorf