Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Hi everybody, I just stumbled across XP getting its time from microsoft on every boot. I'd love for my Linux-box to get its system time from some time-server on the internet, too!
There's gotta be a way... I just don't know how!
I guess I need
a: some kind of prog/shell script to update the time
b: The URL/IP of a reliable time-server
their servers seem good enough, and the other info there might be useful. BUT you don't really need all that.... assuming you're online no boot... stick this in your rc.local
This is basically the same thing Bluecat is pointing out, but the standalone as opposed to the server.
If you dig compiling things on your own, try this little toy. I think this is exactly what you're aiming for. Scuttlebutt is that MS ripped off this code. Netdate
The best way to use it is:
netdate ntp1.(insert major university here).edu
No kidding, pretty much every college and a lot of business run time servers. These tier 1 time servers in turn update from the Cesium clock and blah blah blah super geekdom. Best to choose one in your timezone though :P
Then just stuff the line in rc.local and time is set every boot.
The way this is done, generally, is called NTP, the Network Time Protocol. Atomic clocks around the world make this available. Need to run xntpd, small, and requires no attention at all. I did a page for RH and Deb at: www.raymondjones.net/ntpguide.html
HTH, Ray
I like Trevor's approach best, but since I try not to reboot very often I put the rdate command into a script and stored it in my /etc/cron.daily directory. This way it updates at 4 a.m. every morning rather than waiting for a reboot that may not happen for weeks! I didn't have rdate installed on my system, but it was on the Mandrake CDs and took only a few minutes to get it rolling. The technique for getting cron to do it may vary for other distributions; I'm using Mandrake 8.1...
well, it seems a little like overkill to me, running a daemon just to make sure the ime is right. Why should there be any reason to think that the clocks were wrong in the first place. i only sussed out what i did cos the clocks in my network were wonky, so pinging always gave me that annoying 'taking counter measures' message and such like. i can guess that the mem usage of ntpd it pretty minimal, but throwing resources around like that... nrrg , no thanks. i would also even think that setting the clock form a server online every single timei turn the computer on is a bit daft in principle, but it forks into the backgorund for the 3 seconds it's running for... so that can be ignored really. the cron option is the other obvious choice. any more measures than that i think are a bit daft tho. But then on a critical system it might be appropriate.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.