[CentOS] Updating hardware clock from cron

John R Pierce pierce at hogranch.com
Fri Mar 4 20:54:21 UTC 2011


On 03/04/11 12:40 PM, Matt wrote:
>
> I add this to /etc/rc.local
>
> /usr/sbin/ntpdate us.pool.ntp.org
>
> Sets the clock on start up.  Might run it by cron once a month or so too.

thats just the wrong way to go about it.  if your clock is running fast, 
your cronjob will set it backwards, which will cause some interesting 
anomalies in anything time based, could cause a cronjob to trigger 
twice, funny timestamps in emails, etc.

just setup NTP and forget about it, and it will always work right, 
unless your system is really badly broken, whereupon, it would be better 
to fix it than to continue to hack around like this.





More information about the CentOS mailing list