I think I have figured out how to do it right using command-line utilities on CentOS and all RHEL rebuilds (Scientific Linux, etc). I am quite certain that many people miss this piece of information.
The procedure must be performed by root. First of all, you need to edit the /etc/sysconfig/clock file:
Then run the tzdata-update utility. This copies the correct zonefile to /etc/localtime:Code:ZONE="Etc/GMT" UTC=true
Finally, update the system time by either running ntpd or the ntpdate utility.Code:/usr/sbin/tzdata-update
Both are part of the ntp RPM package, so if this is not installed, just use “yum install ntp” to get it installed.
This will make sure your time is correct.Code:/usr/sbin/ntpdate -b ntp.admon.org
You can set a cron job to update the system time on a daily basis like this:
Code:# # Update the system time 55 23 * * * root /usr/sbin/ntpdate -4 -b pool.ntp.org


LinkBack URL
About LinkBacks




Reply With Quote
