LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Setting the computer clock according to a time server on the internet (https://www.linuxquestions.org/questions/linux-software-2/setting-the-computer-clock-according-to-a-time-server-on-the-internet-238741/)

didi86 10-04-2004 03:21 PM

Setting the computer clock according to a time server on the internet
 
Is there a way to automatically set your computer clock according to a timeserver on the internet (eg. time.nist.gov) once a week?

btmiller 10-04-2004 03:33 PM

The easy solution is to use rdate with the -s option (I run this from cron once a day or so on a server and it works well). If you need something a bit more advanced and reliable than that, you can set up NTP (Network Time Protocol), but I've found it to be something of a pain to get going (could be just me, though).

didi86 10-04-2004 03:56 PM

I managed to get NTP running (with YAST, SuSE 9.1). But how do I get it to syncronize the time every so often???

IBall 10-04-2004 09:48 PM

Use cron.
An entry in /etc/crontab such as:
Code:

15 20 * * 7 "ntpdate serverName"
will run ntpdate to synchronise with the server at 8:15pm once a week on a sunday.

see "man cron" for details

--Ian

JZL240I-U 10-05-2004 04:55 AM

There is also chrony.

spariggio82 10-05-2004 05:45 AM

It's also possible to configure cron to synchronize every time I connect to the net????

JZL240I-U 10-05-2004 05:58 AM

Why would you use cron for that (no regular intervals)?

Just write a script to 1st synchronize and 2nd start your preferred browser...

spariggio82 10-05-2004 06:15 AM

Because I don't use my PC at fixed times but the first thing I do everytime I use it is to connect to the web.

didi86 10-05-2004 06:22 AM

I got it running now.
Thanx everybody

JZL240I-U 10-05-2004 06:24 AM

@spariggio82

Funny answer. That's what I wrote, isn't it, no regular time... :)

If you just want it right at the beginning of each session put it at the end of your boot up script...

spariggio82 10-05-2004 08:44 AM

Dank JZ.

Sorry for the funny answer. I didn't read very well your post.

See you

JZL240I-U 10-05-2004 08:52 AM

You are wellcome. See you too (ahh, to be in Italy, and on its islands ... http://www.ct.ingv.it/UfMoni/ ... when the wheather is fine). :)


All times are GMT -5. The time now is 08:15 AM.