3
ntpdate \- set the date and time via NTP
23
sets the local date and time by polling the Network Time
24
Protocol (NTP) server(s) given as the
26
arguments to determine
27
the correct time. It must be run as root on the local host. A number
28
of samples are obtained from each of the servers specified and a
29
subset of the NTP clock filter and selection algorithms are applied to
30
select the best of these. Note that the accuracy and reliability of
31
ntpdate depends on the number of servers, the number of polls each
32
time it is run and the interval between runs.
34
ntpdate can be run manually as necessary to set the host clock, or it
35
can be run from the host startup script to set the clock at boot time.
36
This is useful in some cases to set the clock initially before
37
starting the NTP daemon ntpd. It is also possible to run ntpdate from
38
a cron script. However, it is important to note that ntpdate with
39
contrived cron scripts is no substitute for the NTP daemon, which uses
40
sophisticated algorithms to maximize accuracy and reliability while
41
minimizing resource use. Finally, since ntpdate does not discipline
42
the host clock frequency as does ntpd, the accuracy using ntpdate is
45
Time adjustments are made by ntpdate in one of two ways. If ntpdate
46
determines the clock is in error more than 0.5 second it will simply
47
step the time by calling the system settimeofday() routine. If the
48
error is less than 0.5 seconds, it will slew the time by calling the
49
system adjtime() routine. The latter technique is less disruptive and
50
more accurate when the error is small, and works quite well when
51
ntpdate is run by cron every hour or two.
53
ntpdate will decline to set the date if an NTP server daemon (e.g.,
54
ntpd) is running on the same host. When running ntpdate on a regular
55
basis from cron as an alternative to running a daemon, doing so once
56
every hour or two will result in precise enough timekeeping to avoid
61
Enable the authentication function and specify the key
62
identifier to be used for authentication as the argument
63
keyntpdate. The keys and key identifiers must match in both the
64
client and server key files. The default is to disable the
65
authentication function.
68
Force the time to always be slewed using the adjtime() system
69
call, even if the measured offset is greater than +-128 ms. The
70
default is to step the time using settimeofday() if the offset
71
is greater than +-128 ms. Note that, if the offset is much
72
greater than +-128 ms in this case, that it can take a long
73
time (hours) to slew the clock to the correct value. During
74
this time. the host should not be used to synchronize clients.
77
Force the time to be stepped using the settimeofday() system
78
call, rather than slewed (default) using the adjtime() system
79
call. This option should be used when called from a startup
83
Enable the debugging mode, in which ntpdate will go through all
84
the steps, but not adjust the local clock. Information useful
85
for general debugging will also be printed.
88
Specify the processing delay to perform an authentication
89
function as the value authdelay, in seconds and fraction (see
90
ntpd for details). This number is usually small enough to be
91
negligible for most purposes, though specifying a value may
92
improve timekeeping on very slow CPU's.
95
Specify the path for the authentication key file as the string
96
keyfile. The default is /etc/ntp.keys. This file should be in
97
the format described in ntpd.
100
Specify the NTP version for outgoint packets as the integer
101
version, which can be 1 or 2. The default is 3. This allows
102
ntpdate to be used with older NTP versions.
105
Specify the number of samples to be acquired from each server
106
as the integer samples, with values from 1 to 8 inclusive. The
110
Query only - don't set the clock.
113
Divert logging output from the standard output (default) to the
114
system syslog facility. This is designed primarily for
115
convenience of cron scripts.
118
Specify the maximum time waiting for a server response as the
119
value timeout, in seconds and fraction. The value is is rounded
120
to a multiple of 0.2 seconds. The default is 1 second, a value
121
suitable for polling across a LAN.
124
Direct ntpdate to use an unprivileged port or outgoing packets.
125
This is most useful when behind a firewall that blocks incoming
126
traffic to privileged ports, and you want to synchronise with
127
hosts beyond the firewall. Note that the -d option always uses
131
Be verbose. This option will cause ntpdate's version
132
identification string to be logged.
136
\- encryption keys used by ntpdate.
138
The slew adjustment is actually 50% larger than the measured offset,
139
since this (it is argued) will tend to keep a badly drifting clock
140
more accurate. This is probably not a good idea and may cause a
141
troubling hunt for some values of the kernel variables tick and
144
David L. Mills (mills@udel.edu)
146
This manpage converted from html to roff by
147
Fabrizio Polacco <fpolacco@debian.org>