2 .\" $FreeBSD: src/usr.sbin/ntp/doc/ntpdate.8,v 1.1.2.5 2003/03/11 22:31:29 trhodes Exp $
9 .Nd set the date and time via NTP
23 The functionality of this program is now available
33 After a suitable period of
36 utility is to be retired from this
41 utility sets the local date and time by polling the
42 Network Time Protocol (NTP) server(s) given as the
44 arguments to determine the correct time.
45 It must be run as root on
47 A number of samples are obtained from each of the
48 servers specified and a subset of the NTP clock filter and
49 selection algorithms are applied to select the best of these.
51 that the accuracy and reliability of
54 the number of servers, the number of polls each time it is run and
55 the interval between runs.
57 The following options are available:
58 .Bl -tag -width indent
60 Enable the authentication function and specify the key
61 identifier to be used for authentication as the argument
63 The keys and key identifiers must match
64 in both the client and server key files.
65 The default is to disable
66 the authentication function.
68 Force the time to always be slewed using the
71 call, even if the measured offset is greater than +-128 ms.
73 default is to step the time using
76 greater than +-128 ms.
77 Note that, if the offset is much greater
78 than +-128 ms in this case, it can take a long time (hours) to
79 slew the clock to the correct value.
80 During this time, the host
81 should not be used to synchronize clients.
83 Force the time to be stepped using the
86 call, rather than slewed (default) using the
89 This option should be used when called from a startup file at boot
92 Enable the debugging mode, in which
95 through all the steps, but not adjust the local clock.
97 useful for general debugging will also be printed.
99 Specify the processing delay to perform an authentication
100 function as the value
102 in seconds and fraction
106 This number is usually small
107 enough to be negligible for most purposes, though specifying a
108 value may improve timekeeping on very slow CPU's.
110 Specify the path for the authentication key file as the string
115 should be in the format described in
118 Specify the NTP version for outgoint packets as the integer
124 to be used with older NTP versions.
126 Specify the number of samples to be acquired from each server
129 with values from 1 to 8 inclusive.
132 Query only - don't set the clock.
134 Divert logging output from the standard output (default) to the
138 This is designed primarily for
143 Specify the maximum time waiting for a server response as the
146 in seconds and fraction.
148 rounded to a multiple of 0.2 seconds.
149 The default is 1 second, a
150 value suitable for polling across a LAN.
154 to use an unprivileged port for outgoing
156 This is most useful when behind a firewall that blocks
157 incoming traffic to privileged ports, and you want to synchronise
158 with hosts beyond the firewall.
162 always uses unprivileged ports.
165 This option will cause
168 identification string to be logged.
173 utility can be run manually as necessary to set the
174 host clock, or it can be run from the host startup script to set
175 the clock at boot time.
176 This is useful in some cases to set the
177 clock initially before starting the NTP daemon
185 However, it is important to note that
190 scripts is no substitute for the NTP
191 daemon, which uses sophisticated algorithms to maximize accuracy
192 and reliability while minimizing resource use.
195 does not discipline the host clock frequency as
203 Time adjustments are made by
209 determines the clock is in error more
210 than 0.5 second it will simply step the time by calling the system
213 If the error is less than 0.5
214 seconds, it will slew the time by calling the system
217 The latter technique is less disruptive
218 and more accurate when the error is small, and works quite well
228 utility will decline to set the date if an NTP server
231 is running on the same host.
235 on a regular basis from
238 an alternative to running a daemon, doing so once every hour or two
239 will result in precise enough timekeeping to avoid stepping the
242 If NetInfo support is compiled into
246 argument is optional if
249 time server in the NetInfo configuration for
252 .Bl -tag -width /etc/ntp.keys -compact
254 contains the encryption keys used by
260 The slew adjustment is actually 50% larger than the measured
261 offset, since this (it is argued) will tend to keep a badly
262 drifting clock more accurate.
263 This is probably not a good idea and
264 may cause a troubling hunt for some values of the kernel variables
265 .Va kern.clockrate.tick
267 .Va kern.clockrate.tickadj .