2 .\" $FreeBSD: src/usr.sbin/ntp/doc/ntpdate.8,v 1.1.2.5 2003/03/11 22:31:29 trhodes Exp $
3 .\" $DragonFly: src/usr.sbin/ntp/doc/Attic/ntpdate.8,v 1.2 2003/06/17 04:29:58 dillon Exp $
10 .Nd set the date and time via NTP
24 The functionality of this program is now available
34 After a suitable period of
37 utility is to be retired from this
42 utility sets the local date and time by polling the
43 Network Time Protocol (NTP) server(s) given as the
45 arguments to determine the correct time.
46 It must be run as root on
48 A number of samples are obtained from each of the
49 servers specified and a subset of the NTP clock filter and
50 selection algorithms are applied to select the best of these.
52 that the accuracy and reliability of
55 the number of servers, the number of polls each time it is run and
56 the interval between runs.
58 The following options are available:
59 .Bl -tag -width indent
61 Enable the authentication function and specify the key
62 identifier to be used for authentication as the argument
64 The keys and key identifiers must match
65 in both the client and server key files.
66 The default is to disable
67 the authentication function.
69 Force the time to always be slewed using the
72 call, even if the measured offset is greater than +-128 ms.
74 default is to step the time using
77 greater than +-128 ms.
78 Note that, if the offset is much greater
79 than +-128 ms in this case, it can take a long time (hours) to
80 slew the clock to the correct value.
81 During this time, the host
82 should not be used to synchronize clients.
84 Force the time to be stepped using the
87 call, rather than slewed (default) using the
90 This option should be used when called from a startup file at boot
93 Enable the debugging mode, in which
96 through all the steps, but not adjust the local clock.
98 useful for general debugging will also be printed.
100 Specify the processing delay to perform an authentication
101 function as the value
103 in seconds and fraction
107 This number is usually small
108 enough to be negligible for most purposes, though specifying a
109 value may improve timekeeping on very slow CPU's.
111 Specify the path for the authentication key file as the string
116 should be in the format described in
119 Specify the NTP version for outgoint packets as the integer
125 to be used with older NTP versions.
127 Specify the number of samples to be acquired from each server
130 with values from 1 to 8 inclusive.
133 Query only - don't set the clock.
135 Divert logging output from the standard output (default) to the
139 This is designed primarily for
144 Specify the maximum time waiting for a server response as the
147 in seconds and fraction.
149 rounded to a multiple of 0.2 seconds.
150 The default is 1 second, a
151 value suitable for polling across a LAN.
155 to use an unprivileged port for outgoing
157 This is most useful when behind a firewall that blocks
158 incoming traffic to privileged ports, and you want to synchronise
159 with hosts beyond the firewall.
163 always uses unprivileged ports.
166 This option will cause
169 identification string to be logged.
174 utility can be run manually as necessary to set the
175 host clock, or it can be run from the host startup script to set
176 the clock at boot time.
177 This is useful in some cases to set the
178 clock initially before starting the NTP daemon
186 However, it is important to note that
191 scripts is no substitute for the NTP
192 daemon, which uses sophisticated algorithms to maximize accuracy
193 and reliability while minimizing resource use.
196 does not discipline the host clock frequency as
204 Time adjustments are made by
210 determines the clock is in error more
211 than 0.5 second it will simply step the time by calling the system
214 If the error is less than 0.5
215 seconds, it will slew the time by calling the system
218 The latter technique is less disruptive
219 and more accurate when the error is small, and works quite well
229 utility will decline to set the date if an NTP server
232 is running on the same host.
236 on a regular basis from
239 an alternative to running a daemon, doing so once every hour or two
240 will result in precise enough timekeeping to avoid stepping the
243 If NetInfo support is compiled into
247 argument is optional if
250 time server in the NetInfo configuration for
253 .Bl -tag -width /etc/ntp.keys -compact
255 contains the encryption keys used by
261 The slew adjustment is actually 50% larger than the measured
262 offset, since this (it is argued) will tend to keep a badly
263 drifting clock more accurate.
264 This is probably not a good idea and
265 may cause a troubling hunt for some values of the kernel variables
266 .Va kern.clockrate.tick
268 .Va kern.clockrate.tickadj .