Change system time

Centos, Linux Add comments

I found out that a large part of centos servers were out of sync with the current time.

So I fixed them.

First get the current date and time from a time server:
rdate -s tick.uh.edu

Then type
/sbin/hwclock –systohc

This sets the system time as a ‘permanent’ clock so that the time will be correct next time you reboot.

You can also use NTP (Network Time protocol) but I haven’t looked into (yet).
The NTP uses a network of time server to automatically sync your system time with the time server on a regular base.

One Response to “Change system time”

  1. stine Says:

    rdate is depreciated in favor of ntp. pick a 2 or more servers from the list at: http://tf.nist.gov/tf-cgi/servers.cgi (or whatever your country’s standards body recommends) and edit /etc/ntp.conf
    a basic configuration will simply include the following lines:
    server [ip address 1]
    server [ip address 2]

    then start ntp using /etc/init.d/ntp start
    or use “chkconfig ntp on” to set it to start on boot.

    If you have several servers, you should consider setting up a single machine to sync from NIST, and then sync the rest of your machines to that one.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in