On 4/8/2021 6:07 PM, the...@sys-concept.com wrote:
Try to set system clock via script:

/usr/sbin/htpdate 1.ro.pool.ntp.org
/sbin/hwclock -w

But when I run it always prints:
Offset 38.000 seconds

The system clock does not adjust.


The hardware clock syncs to the software clock. If, when you run the date command, it prints the correct time (accounting for timezones) then as far as I know, that is the time your hardware clock uses. Besides, 38 seconds is not bad. Unless you are doing something between computers that requires EXTREMELY precise time, then I wouldn't bother. If you do want to fix things, ntpdate is kind of old (I assume that's what you meant, as I've never heard of htpdate). You can accomplish the same thing with the ntp command. Just use: ntpd -g -q. That will set the clock once according to the pool server, then quit. And it sets the clock, no matter how far off it is.



Reply via email to