Have you ever wondered how to easily change the date, time, and time zone configuration on your RedHat Linux server? Every once in a while I need to manipulate the date or time, especially when I ship servers to a new location in a different time zone, and I always fumble around for the commands.
Here is the easiest and fastest method I can find to do this:
- First of all you need an X-Server running. Either start one up remotely on your workstation, or login to the graphical login screen on the console to your server.
- Now run the appropriate RedHat utility to set your time as the root user.
On RedHat AS4, the command is:
/usr/bin/system-config-time
On RedHat AS3, the command is:
/usr/bin/redhat-config-time
- This will open a GUI display from which you can quicky change the date, time, and time zone for your server. This utility is pretty self explanatory on how to use.
- Another setting I'll change through this utility is to point my server at a Network Time Protocol (NTP) server. This helps to ensure that it's date and time are kept as accurate as possible by synchronizing it's time with a group of external time servers. To do this, use the configuration utility above and go to the "Network Time Protocol" tab.
In the text box labeled Server add a few NTP servers. I'll usually add the following 3 servers:
0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org
Simply add the servers listed above, one at a time, into the Server text box and then click on the Add button.
- Click the OK button to close down the Date/Time utility. Your time should now be properly configured.
- At your shell prompt you can run the ntpq command to check the synchronization status of your server with the external time serves.
As root, run the command:
ntpq -p
And your output should look something like:
root@as1 filmoregroup.com [asdb] > ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== +ns1.dns.pciwest 204.123.2.5 2 u 562 1024 377 76.131 -2.912 1.129 +dns1.tjgroup.no 192.43.244.18 2 u 550 1024 377 143.463 1.390 0.422 *time4.stupi.se .PPS. 1 u 604 1024 377 122.685 0.087 0.492 LOCAL(0) LOCAL(0) 10 l 35 64 377 0.000 0.000 0.001If the jitter column has a value of 4000.00 for any of the servers then it is usually a sign that your server is not able to synchronize with that server specified on the line with the bad jitter value. You may have a firewall or other internet connectivity problem then.

del.icio.us
Digg
StumbleUpon