When the ntpd
daemon is running, the file: /var/lib/ntp/ntp.drift
gets updated periodically. Example:
17:20 hostname 118 ~> ls -l /var/lib/ntp/ntp.drift
-rw-r--r-- 1 ntp ntp 7 May 20 16:46 /var/lib/ntp/ntp.drift
# So it looks like it was last updated ~34 minutes ago
The file has one number in it, for example, looking at a 4 virtual hosts, I find these values, respectively:
-22.086
-10.214
-13.669
6.045
I assume these are seconds per day(?), but not sure. man ntpd
mentions a different drift file /etc/ntp.drift
which doesn't seem to exist. The man page doesn't explain what units are being used for the drift.
Questions:
- Is
/etc/ntp.drift
actually/var/lib/ntp/ntp.drift
on Ubuntu? - What units is the drift expressed in?
Thanks!
Best Answer
The drift file is /var/lib/ntp/ntp.drift. This is fairly standard. For RH/Fedora, it's /var/lib/ntp/drift.
The units for the drift file are "PPM", or "parts per million". Your clock will drift due to fluctuations in the frequency oscillating the quartz crystal on your motherboard. A fluctuation of just 0.001% (0.00001, or 10 PPM) means losing or gaining about 1 second per day. NTP has finer grained control than that, so we look at errors of margin using 0.0001% (0.000001, or 1 PPM). Thus:
Thus, my drift file shows the value of "2.643" which means my clock is off by 2.643 parts per million, which means it's currently off at 228.3552ms per day.