Tuesday, February 21, 2017

Reset/Update NTP Server


There was an older machine on the network, with an outdated local NTP configuration, and the time was off by a couple minutes. This post shows how to perform a quick update and force sync. Use at your own risk for time sensitive applications.


1. Update the NTP client configuration.


service ntpd stop
vi /etc/ntp.conf
 Find Line
server 192.168.x.x

Change to new server
Save and quit.
 service ntpd start

2.  Force synchronization
 date ; service ntpd stop ; ntpdate 192.168.1.1 ; service ntpd start ; date

In one fell swoop it will give you the current time, stop the service, force an update, start the service and give you the updated time.

Tue Feb 21 11:40:44 AST 2017
Shutting down ntpd:                   [  OK  ]
21 Feb 11:44:28 ntpdate[10457]: step time server 192.168.x.x offset 223.794778 sec
Starting ntpd:                        [  OK  ]
Tue Feb 21 11:44:28 AST 2017


That's it. All updated.