LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-02-2003, 11:52 PM   #1
docGonzo2000
Member
 
Registered: Jan 2003
Location: Texas
Distribution: Libranet 8.1, Slackware 9
Posts: 107

Rep: Reputation: 15
Question 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.
Cheers!

-----------------------------------------------
Running on pure Slack.
 
Old 02-03-2003, 06:57 AM   #2
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 45
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.

ntpdate time.nist.gov

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

server time.nist.gov
server another.time.clock
driftfile /etc/ntp/ntp.drift

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Various clock issues: Clock shows wrong time only in Knoppmyth, & CMOS time change ? davidbix General 1 04-05-2006 09:58 PM
sending data to standard out and to a text file at the same time. liguorir Linux - Software 1 08-23-2005 12:14 PM
Clock keeps going out of time linksocc Linux - General 10 10-01-2003 08:05 AM
Mandrake time clock descentx13 Linux - General 2 05-27-2002 07:42 PM
time clock jimval7 Linux - Distributions 2 03-21-2002 03:04 PM


All times are GMT -5. The time now is 11:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration