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. |
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 |
# 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. |
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.
|
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. |
my suggestion was better ;)
|
I agree. Acid_Kewpie's suggestion was better.
But how do you get it to do that.
|
Quote:
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? |
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? |
All times are GMT -5. The time now is 08:02 AM. |