]> git.pld-linux.org Git - packages/ntp.git/blame - ntpdate.8
- SYNC_DATE doesn't have any sense now
[packages/ntp.git] / ntpdate.8
CommitLineData
c53ea2f8 1.TH ntpdate 8
2.SH NAME
3ntpdate \- set the date and time via NTP
4.SH SYNOPSIS
5.B ntpdate
6.RB [\| \-bBdoqsuv \|]
7.RB [\| \-a
8.IR key \|]
9.RB [\| \-e
10.IR authdelay \|]
11.RB [\| \-k
12.IR keyfile \|]
13.RB [\| \-o
14.IR version \|]
15.RB [\| \-p
16.IR samples \|]
17.RB [\| \-t
18.IR timeout \|]
19.IR server
20.RB [\| ... \|]
21.SH DESCRIPTION
22.B ntpdate
23sets the local date and time by polling the Network Time
24Protocol (NTP) server(s) given as the
25.I server
26arguments to determine
27the correct time. It must be run as root on the local host. A number
28of samples are obtained from each of the servers specified and a
29subset of the NTP clock filter and selection algorithms are applied to
30select the best of these. Note that the accuracy and reliability of
31ntpdate depends on the number of servers, the number of polls each
32time it is run and the interval between runs.
33
34ntpdate can be run manually as necessary to set the host clock, or it
35can be run from the host startup script to set the clock at boot time.
36This is useful in some cases to set the clock initially before
37starting the NTP daemon ntpd. It is also possible to run ntpdate from
38a cron script. However, it is important to note that ntpdate with
39contrived cron scripts is no substitute for the NTP daemon, which uses
40sophisticated algorithms to maximize accuracy and reliability while
41minimizing resource use. Finally, since ntpdate does not discipline
42the host clock frequency as does ntpd, the accuracy using ntpdate is
43limited.
44
45Time adjustments are made by ntpdate in one of two ways. If ntpdate
46determines the clock is in error more than 0.5 second it will simply
47step the time by calling the system settimeofday() routine. If the
48error is less than 0.5 seconds, it will slew the time by calling the
49system adjtime() routine. The latter technique is less disruptive and
50more accurate when the error is small, and works quite well when
51ntpdate is run by cron every hour or two.
52
53ntpdate will decline to set the date if an NTP server daemon (e.g.,
54ntpd) is running on the same host. When running ntpdate on a regular
55basis from cron as an alternative to running a daemon, doing so once
56every hour or two will result in precise enough timekeeping to avoid
57stepping the clock.
58.SH OPTIONS
59.TP
60.BI \-a \ key
61Enable the authentication function and specify the key
62identifier to be used for authentication as the argument
63keyntpdate. The keys and key identifiers must match in both the
64client and server key files. The default is to disable the
65authentication function.
66.TP
67.B \-B
68Force the time to always be slewed using the adjtime() system
69call, even if the measured offset is greater than +-128 ms. The
70default is to step the time using settimeofday() if the offset
71is greater than +-128 ms. Note that, if the offset is much
72greater than +-128 ms in this case, that it can take a long
73time (hours) to slew the clock to the correct value. During
74this time. the host should not be used to synchronize clients.
75.TP
76.B \-b
77Force the time to be stepped using the settimeofday() system
78call, rather than slewed (default) using the adjtime() system
79call. This option should be used when called from a startup
80file at boot time.
81.TP
82.B \-d
83Enable the debugging mode, in which ntpdate will go through all
84the steps, but not adjust the local clock. Information useful
85for general debugging will also be printed.
86.TP
87.BI \-e \ authdelay
88Specify the processing delay to perform an authentication
89function as the value authdelay, in seconds and fraction (see
90ntpd for details). This number is usually small enough to be
91negligible for most purposes, though specifying a value may
92improve timekeeping on very slow CPU's.
93.TP
94.BI \-k \ keyfile
95Specify the path for the authentication key file as the string
96keyfile. The default is /etc/ntp.keys. This file should be in
97the format described in ntpd.
98.TP
99.BI \-o \ version
100Specify the NTP version for outgoint packets as the integer
101version, which can be 1 or 2. The default is 3. This allows
102ntpdate to be used with older NTP versions.
103.TP
104.BI \-p \ samples
105Specify the number of samples to be acquired from each server
106as the integer samples, with values from 1 to 8 inclusive. The
107default is 4.
108.TP
109.B \-q
110Query only - don't set the clock.
111.TP
112.B \-s
113Divert logging output from the standard output (default) to the
114system syslog facility. This is designed primarily for
115convenience of cron scripts.
116.TP
117.BI \-t \ timeout
118Specify the maximum time waiting for a server response as the
119value timeout, in seconds and fraction. The value is is rounded
120to a multiple of 0.2 seconds. The default is 1 second, a value
121suitable for polling across a LAN.
122.TP
123.B \-u
124Direct ntpdate to use an unprivileged port or outgoing packets.
125This is most useful when behind a firewall that blocks incoming
126traffic to privileged ports, and you want to synchronise with
127hosts beyond the firewall. Note that the -d option always uses
128unprivileged ports.
129.TP
130.B \-v
131Be verbose. This option will cause ntpdate's version
132identification string to be logged.
133.SH FILES
134.TP
135.I /etc/ntp.keys
136\- encryption keys used by ntpdate.
137.SH BUGS
138The slew adjustment is actually 50% larger than the measured offset,
139since this (it is argued) will tend to keep a badly drifting clock
140more accurate. This is probably not a good idea and may cause a
141troubling hunt for some values of the kernel variables tick and
142tickadj.
143.SH AUTHOR
144David L. Mills (mills@udel.edu)
145.br
146This manpage converted from html to roff by
147Fabrizio Polacco <fpolacco@debian.org>
148
This page took 0.062569 seconds and 4 git commands to generate.