[CentOS] Date drift and ntpd

Jerry Franz jfranz at freerun.com
Fri Aug 13 21:06:06 UTC 2010


On 8/12/2010 8:03 PM, Les Mikesell wrote:
> Warren Young wrote:
>>
>> The strategy I recommended is based on the fact that its worst case
>> behavior (a small negative jump every hour) is not a problem for me.  If
>> it is a problem for your application, you need a different design.
>
> It's a bad idea in the general case.  If you have scheduled jobs, ntpdate may
> jump the clock enough to miss the trigger or run them twice, where ntpd always
> tries to move the clock fractional seconds at a time so as not to let that
> happen.   Plus, ntpdate does no sanity check at all - if the clock source is
> badly off, the client will follow blindly even if it goes to the wrong century.
>

Whereas ntpd will simply quietly fail to sync at all if it is more than 
a few minutes off. ;)

I've used ntpdate to keep exceptionally balky machines in phase before. 
If you do it frequently enough that the jump is never more than a second 
or two it works fine as long as you can tolerate the occasional out of 
order timestamp. Cron is sensitive only to the minute level and if you 
are paranoid about it, sync it at an odd time (something like 47 minutes 
after the hour) that just won't conflict with other cronjobs.

-- 
Benjamin Franz





More information about the CentOS mailing list