Synching clock to standard time
I've been trying to figure out, all day, how I can sync my computer's clock to the nist time servers. This was really easy to do on Redhat 8, but it isn't so easy on Slackware. Been combing through the documentation for ntpd for as much time as I can spare, and have come up with nothing.
My clock keeps getting knocked off, for some reason, and I'd like to be able to sync it with an atomic clock. (It also probably has something to do with the fact that I'm a scientist, and I like exactness as much as possible.)
Any help would be greatly appreciated.
Running on pure Slack.
Well, ntpd is the correct program for continous clock sync to an external time server. It runs as a background daemon. If you desire to set the clock only once like at boot then ntpdate can be used. This could also be setup as a cronjob like every 12 hours, etc.
Once ntpd is running the above command cannot function. So if you want to do an initial sync when first booted then use the above and then start the ntpd daemon. I usually use the /etc/rc.d/rc.inet2 script at the end to place the desired commands. It has to be after networking has been been started, but rc.local can be used as well.
As for ntpd, it requires a conf file in /etc. It is called ntp.conf that needs to be created or edited. It contains the name of servers to sync with. Like
The driftfile will just contain a negative or positive number that it uses to adjust the clock as required. To create it; "touch /etc/ntp/ntp.drift" should create an empty file. You should then be able to run ntpd and view the messages file for several minutes to watch the activity. (tail -f /var/log/messages) It should post info regarding it is synced or lost sync.
I personally use both methods depending on what it is I am setting up. One local server running ntpd on a network can be a time server for the other machines on the network. Help reduce the load on the public time servers. Also, carefull listing servers from different sources. I have seen some very minor time differences, perhaps from the delay calcs, that keeps ntp resyncing back and forth loosing sync. Another reason to use one local time server to serve your other machines as well.
Hope it helps.
|All times are GMT -5. The time now is 11:14 AM.|