liquidzoo Posted November 17, 2003 Report Share Posted November 17, 2003 I got this command from illogic-al tonight on IRC and thought I would share it with you. I made myself a small script that will do it automatically. The command is rdate. First off, make sure rdate is installed by issuing the following command as root: urpmi rdate Then fire up your favorite text editor and paste in the following line of text: su -c 'rdate -p -s clock.psu.edu' Save that as whatever you want, just remember the filename. In my case, it is time.sh Open up a console and change to wherever you saved the script and issue the following command, substituting in your filename for my time.sh: chmod +x time.sh After that, when you want to make sure your time is correct, and set it if not; open a terminal and change to where you saved your script. Once there, issue ./time.sh Once again, substituting your filename for mine. It will prompt you for your root password (this is so it has access to change the system time, it will only be for one command). Once you have entered your root password, it will print the time in your timezone from the clock.psu.edu server and set the system time if yours is off. You can substitute your favorite time server for the clock.psu.edu if you would like. Enjoy! EDIT to correct the command. It wasn't working on my system the way I had typed it. Quote Link to comment Share on other sites More sharing options...
coverup Posted November 18, 2003 Report Share Posted November 18, 2003 Actually, rdate sets time received from a network host, in this example the romte host is clock.psu.edu. You can update time automatically by adding something like this to root's crontab file 5 1 * * * rdate -s your.trusted.network.host This will make your computer to syncronise with the remote host every day (night, hour, etc) without you having to run any scripts (and type in the root password). Quote Link to comment Share on other sites More sharing options...
Qchem Posted November 18, 2003 Report Share Posted November 18, 2003 Or you could use network time protocol and ntpd (the daemon) to do the same thing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.