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