EvilRob.org -> Unix -> Ntpdate with big offsets

Ntpdate for clocks that are way out of date

ntpdate is a near universal clock syncronization program. It's pretty complicated and can be very accurate, but I've never used it for much more than "close enough". One of my systems loses interrupts or something, so the clock runs very slowly and got way out of sync. In trying to use ntpdate to sync the clock, I encountered this:

# ntpdate time.timeserver.com
18 Jun 13:04:33 ntpdate[2711]: Can't adjust the time of day: Invalid argument

The solution is to use "ntpdate -b". The error is caused by a too large argument/offset by ntpdate to the syscall adjusting the time. The -b switch forces ntpdate to use a different system call that accepts a larger offset. This worked for sure on Linux; not sure about other platform support.

Looking for more unix information? See my weblog for more.
©1995-2005 Rob Meyer. All Rights Reserved