[ntp:questions] ntpd -q and driftfile
Richard B. Gilbert
rgilbert88 at comcast.net
Tue Mar 22 20:27:47 UTC 2011
On 3/22/2011 12:07 PM, bombjack wrote:
> On Mar 22, 4:20 pm, "Richard B. Gilbert"<rgilber... at comcast.net>
>> On 3/22/2011 2:56 AM, prashant sherin wrote:
>>>> ntpd is intended to for continuous, not periodic running. You are not
>>>> using it correctly.
>>> Thanks for the quick reply.
>>> ntpd does allow us to run this way. From the ntpd man page:
>>> -q Exit the ntpd just after the first time the clock is set.
>>> This behavior mimics that of the ntpdate program, which is to be
>>> retired. The -g and -x options can
>>> be used with this option. Note: The kernel time
>>> discipline is disabled with this option.
>>> The idea is to use it as ntp client.
>>> Thanks and Regards,
>> The fact that it's possible to use NTPD that way does NOT mean that it
>> is anywhere close to using NTPD as designed nor is it the best way for
>> most purposes! You could do almost as well by setting the time from
>> from my wrist watch which uses VLF radio to receive time broadcasts.
>> "Normal usage" is to run NTPD 24 hours a day, 365 days a year or 366 on
>> leap years.
> First: Thanks for quick response
> I am fully aware fo how ntpd should be used, i.e. 24/7/365, but that
> is not what I am asking for. As I stated above, I need to make sure
> the system clock is roughly (your wrist watch would do) the correct
> time ASAP during boot as other systems will use this time and can't
> easily be changed later if time deviates too much when ntpd (later)
> has initial sync. I presume you are aware of that ntpd will take some
> samples/time before syncing and that is not good enough. therefore, I
> still wonder if ntpd -q could be used in favour of rdate?
If you are satisfied with hours and minutes; e.g. 4:02PM you can use
NTPDATE or NTP -g, (check this against the NPTD documentation, I'm
running on memory and may have dropped at bit or two). NTPDATE is
"deprecated"; it's no longer maintained or distributed. There are,
however, a few thousand or a few million copies either in use or just
stored "in case we need it".
Many of the people who hang out here are trying to get a whole herd of
computers and other devices to agree on a common time that is a
reasonable approximation of the *correct* time. This is necessary for
things like analyzing log files. Some have legal requirements for time
stamping transactions. Some are hobbyists who see it as a technical
More information about the questions