version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ntpdate |
|
|
2 |
!!!ntpdate |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
FILES |
|
|
8 |
BUGS |
|
|
9 |
AUTHOR |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
ntpdate - set the date and time via NTP |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__ntpdate__ [[__-bBdoqsuv__] [[__-a__ ''key''] |
|
|
19 |
[[__-e__ ''authdelay''] [[__-k__ ''keyfile''] |
|
|
20 |
[[__-o__ ''version''] [[__-p__ ''samples''] |
|
|
21 |
[[__-t__ ''timeout''] ''server'' |
|
|
22 |
[[__...__] |
|
|
23 |
!!DESCRIPTION |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__ntpdate__ sets the local date and time by polling the |
|
|
27 |
Network Time Protocol (NTP) server(s) given as the |
|
|
28 |
''server'' arguments to determine the correct time. It |
|
|
29 |
must be run as root on the local host. A number of samples |
|
|
30 |
are obtained from each of the servers specified and a subset |
|
|
31 |
of the NTP clock filter and selection algorithms are applied |
|
|
32 |
to select the best of these. Note that the accuracy and |
|
|
33 |
reliability of ntpdate depends on the number of servers, the |
|
|
34 |
number of polls each time it is run and the interval between |
|
|
35 |
runs. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
ntpdate can be run manually as necessary to set the host |
|
|
39 |
clock, or it can be run from the host startup script to set |
|
|
40 |
the clock at boot time. This is useful in some cases to set |
|
|
41 |
the clock initially before starting the NTP daemon ntpd. It |
|
|
42 |
is also possible to run ntpdate from a cron script. However, |
|
|
43 |
it is important to note that ntpdate with contrived cron |
|
|
44 |
scripts is no substitute for the NTP daemon, which uses |
|
|
45 |
sophisticated algorithms to maximize accuracy and |
|
|
46 |
reliability while minimizing resource use. Finally, since |
|
|
47 |
ntpdate does not discipline the host clock frequency as does |
|
|
48 |
ntpd, the accuracy using ntpdate is limited. |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
Time adjustments are made by ntpdate in one of two ways. If |
|
|
52 |
ntpdate determines the clock is in error more than 0.5 |
|
|
53 |
second it will simply step the time by calling the system |
|
|
54 |
settimeofday() routine. If the error is less than 0.5 |
|
|
55 |
seconds, it will slew the time by calling the system |
|
|
56 |
adjtime() routine. The latter technique is less disruptive |
|
|
57 |
and more accurate when the error is small, and works quite |
|
|
58 |
well when ntpdate is run by cron every hour or |
|
|
59 |
two. |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
ntpdate will decline to set the date if an NTP server daemon |
|
|
63 |
(e.g., ntpd) is running on the same host. When running |
|
|
64 |
ntpdate on a regular basis from cron as an alternative to |
|
|
65 |
running a daemon, doing so once every hour or two will |
|
|
66 |
result in precise enough timekeeping to avoid stepping the |
|
|
67 |
clock. |
|
|
68 |
!!OPTIONS |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
__-a__ ''key'' |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
Enable the authentication function and specify the key |
|
|
75 |
identifier to be used for authentication as the argument |
|
|
76 |
keyntpdate. The keys and key identifiers must match in both |
|
|
77 |
the client and server key files. The default is to disable |
|
|
78 |
the authentication function. |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
__-B__ |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
Force the time to always be slewed using the adjtime() |
|
|
85 |
system call, even if the measured offset is greater than |
|
|
86 |
+-128 ms. The default is to step the time using |
|
|
87 |
settimeofday() if the offset is greater than +-128 ms. Note |
|
|
88 |
that, if the offset is much greater than +-128 ms in this |
|
|
89 |
case, that it can take a long time (hours) to slew the clock |
|
|
90 |
to the correct value. During this time. the host should not |
|
|
91 |
be used to synchronize clients. |
|
|
92 |
|
|
|
93 |
|
|
|
94 |
__-b__ |
|
|
95 |
|
|
|
96 |
|
|
|
97 |
Force the time to be stepped using the settimeofday() system |
|
|
98 |
call, rather than slewed (default) using the adjtime() |
|
|
99 |
system call. This option should be used when called from a |
|
|
100 |
startup file at boot time. |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
__-d__ |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
Enable the debugging mode, in which ntpdate will go through |
|
|
107 |
all the steps, but not adjust the local clock. Information |
|
|
108 |
useful for general debugging will also be |
|
|
109 |
printed. |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
__-e__ ''authdelay'' |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
Specify the processing delay to perform an authentication |
|
|
116 |
function as the value authdelay, in seconds and fraction |
|
|
117 |
(see ntpd for details). This number is usually small enough |
|
|
118 |
to be negligible for most purposes, though specifying a |
|
|
119 |
value may improve timekeeping on very slow |
|
|
120 |
CPU's. |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
__-k__ ''keyfile'' |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
Specify the path for the authentication key file as the |
|
|
127 |
string keyfile. The default is /etc/ntp.keys. This file |
|
|
128 |
should be in the format described in ntpd. |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
__-o__ ''version'' |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
Specify the NTP version for outgoint packets as the integer |
|
|
135 |
version, which can be 1 or 2. The default is 3. This allows |
|
|
136 |
ntpdate to be used with older NTP versions. |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
__-p__ ''samples'' |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
Specify the number of samples to be acquired from each |
|
|
143 |
server as the integer samples, with values from 1 to 8 |
|
|
144 |
inclusive. The default is 4. |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
__-q__ |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
Query only - don't set the clock. |
|
|
151 |
|
|
|
152 |
|
|
|
153 |
__-s__ |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
Divert logging output from the standard output (default) to |
|
|
157 |
the system syslog facility. This is designed primarily for |
|
|
158 |
convenience of cron scripts. |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
__-t__ ''timeout'' |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
Specify the maximum time waiting for a server response as |
|
|
165 |
the value timeout, in seconds and fraction. The value is is |
|
|
166 |
rounded to a multiple of 0.2 seconds. The default is 1 |
|
|
167 |
second, a value suitable for polling across a |
|
|
168 |
LAN. |
|
|
169 |
|
|
|
170 |
|
|
|
171 |
__-u__ |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
Direct ntpdate to use an unprivileged port or outgoing |
|
|
175 |
packets. This is most useful when behind a firewall that |
|
|
176 |
blocks incoming traffic to privileged ports, and you want to |
|
|
177 |
synchronise with hosts beyond the firewall. Note that the -d |
|
|
178 |
option always uses unprivileged ports. |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
__-v__ |
|
|
182 |
|
|
|
183 |
|
|
|
184 |
Be verbose. This option will cause ntpdate's version |
|
|
185 |
identification string to be logged. |
|
|
186 |
!!FILES |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
''/etc/ntp.keys'' |
|
|
190 |
|
|
|
191 |
|
|
|
192 |
- encryption keys used by ntpdate. |
|
|
193 |
!!BUGS |
|
|
194 |
|
|
|
195 |
|
|
|
196 |
The slew adjustment is actually 50% larger than the measured |
|
|
197 |
offset, since this (it is argued) will tend to keep a badly |
|
|
198 |
drifting clock more accurate. This is probably not a good |
|
|
199 |
idea and may cause a troubling hunt for some values of the |
|
|
200 |
kernel variables tick and tickadj. |
|
|
201 |
!!AUTHOR |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
David L. Mills (mills@udel.edu) |
|
|
205 |
This manpage converted from html to roff by Fabrizio Polacco |
|
|
206 |
---- |