Do “service ntpd restart” and “ntpdate ” do the same work

ntpntpdntpdate

I often get large offsets when checking ntpd using ntpq -p, I generally restart the ntp daemon and it fixes the issue. I wanted to know if i can try the ntpdate <ntp-server-name> instead of restarting ntpd. Since this is a production box wanted to be sure before implementing it.

Best Answer

ntpdate and ntpd are different tools, but one of them helps another.

ntpdate is used to synchronize the system clock at once immediately. It takes time from a ntpd server, which has synchronized status (stratum 1 - 4).

ntpd service sets system clock softly. It can spend several hours to eliminate the lag of system clock for several minutes. All this time it has synchronized status stratum 16 - it means the system clock isn't synchronized. The service restart command service ntpd restart is used only to apply changes in its configuration file.

ntpdate is usually used to synchronize the system clock of personal computer at startup. ntpd service is usually used to synchronize the system clock of server all-time.