How to adjust the next update in NTP?
Hi!
I have a problem in configuring ntp client. I want to synchronize with remote server in every second or minute. I configured ntp.conf but I didn't figure out how I can change the delay update. The ntpq -p shows the following, where the next update is after 10. Could you tell me the measure used. 10 what? And how I can adjust that? Quote:
|
when is defined as sec/min/hr since last received packet and is not adjustable. The poll time is adjustable with the min value being 64 and the max 1024 seconds. If the server in your post is the only one listed in your ntp.conf file your client will never sync to it since the offset is greater then 1000 seconds. Basically ntp will compensate for clock drift and once stabilized will automatically adjust the poll time.
As a side note what linux distribution/ version are you running? |
In fact I have a time stamp project, so the time must be accurate and any manual change (By hacker for example) must be fixed rapidly. I can do that by ntpdate in cron and that permit a refresh on each minute or using ntp client.
However, ntp client doesn't work in the right manner. According to the last comment when is always less than poll which is not the case. In addition, when I change the time (date -s hh:mm:ss) with less than 1000 s difference, the adjustment did not happen in the next 64s. I use ubuntu 10.10 and this is my ntp.conf file if needed: Quote:
|
Correction I posted the default values. The polling range is from 16 seconds (4) and 1.5 days (7).
ntp does not necessarily perform a time jump. If the offset is <128ms it will set the correct time otherwise it will slew the clock frequency to speed up or slow down. When ntpd first starts it will set time to any value without restrictions once. Otherwise it will update time as posted. Whereas ntpdate will set the clock once it does not provide for any drift compensation. If your application does not mind absolute time jumps then nptdate via cron might be the best choice. http://www.ntp.org/ntpfaq/NTP-s-algo.htm |
Thank you michaelk
But I have a little more question. Is there a way to force NTP to perform a time jump? How we can change the polling value? For those who want to use a script and execute it regularly (each minute) using cron, this is mine. Enjoy! Code:
GOON=1 |
To change the minpoll value add the following to the ntp.conf file.
minpoll 4 (2^x i.e. 16 seconds, values range from 4 to 10) maxpoll 4 This will force ntp to always poll and 16 seconds. npt is not designed to update with a time jump except at initial start up. Curious why you expect someone or something to change time. |
All times are GMT -5. The time now is 05:40 AM. |