NTP Tips


Summary

NTP is robust, but rather complicated, and I can never remember the correct options for the things I need to do. These are my notes for some common NTP tasks.


Detail

Compare localhost time to known server: ntpdate -q pool.ntp.org

NEW: Immediately switch localhost time to correct time from known server: ntpd -gq (NOTE: you have to stop the regular NTP service for this to work)

OLD: Immediately switch localhost time to correct time from known server: ntpdate -b pool.ntp.org (NOTE: you have to stop the regular NTP service for this to work)

Show the hardware clock: hwclock --show (NOTE: sudo required)

Sync the NTP time to the hardware clock: hwclock --systohc (NOTE: sudo required)