LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2003, 11:56 AM   #1
teeno
Member
 
Registered: Jul 2001
Posts: 72

Rep: Reputation: 15
How do I keep accurate time?


Hi All,

Does anyone know how I can make sure my Linux box keep accurate time? The problem is that I am using it for barcode labour collection and it keeps gaining about a minute after a month. Is there any way that I can get my Linux box to update its time using the Internet once a week?

Thank in advance.
 
Old 06-23-2003, 12:10 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
You can set it to run ntpdate to go to a timeserver on the net once a day.

Or, use ntp to watch the internal clock on a regular basis.

Check www.ntp.org
 
Old 06-23-2003, 12:15 PM   #3
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
# su -
# crontab -e

Then in your crontab file add a line:
20 4 * * 0 /usr/sbin/ntpdate time.nist.gov

You might also want to put the same line in your /etc/rc.d/rc.local.

Note that the Red Hat 9 docs (/usr/share/doc/ntp-*) say that ntpdate is now deprecated in favor of ntpd. Perhaps I'm just using it incorrectly, but I've had problems with ntpd for simple updates like you're trying to do. ntpdate works quite well. Also read the docs - you can use multiple time servers, etc.
 
Old 06-23-2003, 12:16 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
ntp is good, if you are actually having a biod clock skew problem, rather than simply wanting to be accurate then you can run ntp as a client daemon on your machine, this will do much more than simply reset the time every so often, as it will calculate average drift of the time and continually make minor adjustments to the time based on results polled from a number of remote ntp servers. so in theory the time is never more than a second or so out, even if you only contact the remote servers every hours or such.
 
Old 06-26-2003, 08:42 AM   #5
teeno
Member
 
Registered: Jul 2001
Posts: 72

Original Poster
Rep: Reputation: 15
Thumbs up

Thank you for all your help.

I have decided to use ntpdate and setup a cron job as suggested.

All your help is much appreciated.

Thank you.
 
Old 06-26-2003, 08:56 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
my suggestion was better
 
Old 10-11-2003, 04:40 PM   #7
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Rep: Reputation: 15
I agree. Acid_Kewpie's suggestion was better.

But how do you get it to do that.
 
Old 10-11-2003, 04:49 PM   #8
bmike1
Member
 
Registered: Jul 2003
Posts: 132

Rep: Reputation: 15
Quote:
Originally posted by jvannucci
# su -
# crontab -e

Then in your crontab file add a line:
20 4 * * 0 /usr/sbin/ntpdate time.nist.gov


root@bmike1:/home/knoppix# ntpdate time.nist.gov
11 Oct 13:45:03 ntpdate[1091]: no server suitable for synchronization found
root@bmike1:/home/knoppix#

Why did it say that?
 
Old 10-11-2003, 08:04 PM   #9
mossy
Member
 
Registered: Aug 2003
Location: USexIRL
Distribution: *nix
Posts: 849

Rep: Reputation: 30
Prolly find and download ntp and or ntpd. then install it and read the documentation.

...

Here I found http://www.ntp.org/ this may help configging a server.

Unless acid_kewpie has any other suggestions?
 
  


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
More accurate task scheduler lowspeed Linux - General 7 02-17-2005 09:21 PM
How accurate is LM_Sensors Mojojo Linux - Software 0 12-23-2004 08:49 AM
Finding accurate IRQ #'s? Ineed2muchHelp Linux - Networking 4 06-21-2004 06:09 PM
System time not staying accurate sp|k3 Linux - General 10 01-02-2004 07:14 PM
CPU info, is it accurate? ALF Linux - Software 3 08-03-2003 11:45 PM


All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration