LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Updating System time from some Inet time server (https://www.linuxquestions.org/questions/linux-general-1/updating-system-time-from-some-inet-time-server-10307/)

Steave 12-18-2001 03:22 PM

Updating System time from some Inet time server
 
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

Thanx!

bluecadet 12-18-2001 04:48 PM

it's an absolute doddle.

you use rdate locally, and just need to find a decent time server. i found some, but i can't remember the address...

gone surfing....

http://www.august.net/settime.html

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

rdate -s tick.august.net

come on... could it get an easier?! :D

finegan 12-19-2001 11:36 AM

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.

Cheers,

Finegan

Steave 12-19-2001 11:47 AM

Thanx everyone! Got that figured out... Even found some "administrative" time server for my time zone!

If anyones interested: Timezone:

CET (Germany, France, ...)
ntp1.ptb.de or ntp2.ptb.de

See ya!

Posterboy 12-20-2001 09:47 AM

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

JimKyle 12-20-2001 09:07 PM

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...

bluecadet 12-21-2001 02:12 PM

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.


All times are GMT -5. The time now is 10:54 AM.