Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.