sntp.1sntpman revision 1.1.1.1
1.de1 NOP
2.  it 1 an-trap
3.  if \\n[.$] \,\\$*\/
4..
5.ie t \
6.ds B-Font [CB]
7.ds I-Font [CI]
8.ds R-Font [CR]
9.el \
10.ds B-Font B
11.ds I-Font I
12.ds R-Font R
13.TH sntp 1sntpman "24 Dec 2013" "4.2.7p404" "User Commands"
14.\"
15.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ava45X/ag-mva44X)
16.\"
17.\" It has been AutoGen-ed December 24, 2013 at 11:39:56 AM by AutoGen 5.18.3pre5
18.\" From the definitions sntp-opts.def
19.\" and the template file agman-cmd.tpl
20.SH NAME
21\f\*[B-Font]sntp\fP
22\- standard Simple Network Time Protocol client program
23.SH SYNOPSIS
24\f\*[B-Font]sntp\fP
25.\" Mixture of short (flag) options and long options
26[\f\*[B-Font]\-flags\f[]]
27[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
28[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
29[ hostname-or-IP ...]
30.sp \n(Ppu
31.ne 2
32
33.SH DESCRIPTION
34\f\*[B-Font]sntp\fP
35can be used as an SNTP client to query a NTP or SNTP server and either display
36the time or set the local system's time (given suitable privilege).  It can be
37run as an interactive command or from a
38\f\*[B-Font]cron\f[]
39job.
40NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
41are defined and described by RFC 5905.
42.sp \n(Ppu
43.ne 2
44
45The default is to write the estimated correct local date and time (i.e. not
46UTC) to the standard output in a format like:
47\f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[]
48where the
49\f\*[B-Font]'(+0800)'\f[]
50means that to get to UTC from the reported local time one must
51add 8 hours and 0 minutes,
52the
53\f\*[B-Font]'+4.567'\f[]
54indicates the local clock is 4.567 seconds behind the correct time
55(so 4.567 seconds must be added to the local clock to get it to be correct).
56Note that the number of decimals printed for this value will change
57based on the reported precision of the server.
58\f\*[B-Font]'+/- 0.089'\f[]
59is the reported
60\fIsynchronization\f[] \fIdistance\f[]
61(in seconds), which represents the maximum error due to all causes.
62If the server does not report valid data needed to calculate the
63synchronization distance, this will be reported as
64\f\*[B-Font]'+/- ?'\f[].
65If the
66\fIhost\f[]
67is different from the
68\fIIP\f[],
69both will be displayed.
70Otherwise, only the 
71\fIIP\f[]
72is displayed.
73Finally, the
74\fIstratum\f[]
75of the host is reported.
76.SH "OPTIONS"
77.TP
78.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
79Force IPv4 DNS name resolution.
80This option must not appear in combination with any of the following options:
81ipv6.
82.sp
83Force DNS resolution of the following host names on the command line
84to the IPv4 namespace.
85.TP
86.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
87Force IPv6 DNS name resolution.
88This option must not appear in combination with any of the following options:
89ipv4.
90.sp
91Force DNS resolution of the following host names on the command line
92to the IPv6 namespace.
93.TP
94.NOP \f\*[B-Font]\-a\f[] \f\*[I-Font]auth\-keynumber\f[], \f\*[B-Font]\-\-authentication\f[]=\f\*[I-Font]auth\-keynumber\f[]
95Enable authentication with the key \fBauth-keynumber\fP.
96This option takes an integer number as its argument.
97.sp
98Enable authentication using the key specified in this option's
99argument.  The argument of this option is the \fBkeyid\fP, a
100number specified in the \fBkeyfile\fP as this key's identifier.
101See the \fBkeyfile\fP option (\fB-k\fP) for more details.
102.TP
103.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]broadcast\-address\f[], \f\*[B-Font]\-\-broadcast\f[]=\f\*[I-Font]broadcast\-address\f[]
104Listen to the address specified for broadcast time sync.
105This option may appear an unlimited number of times.
106.sp
107If specified \fBsntp\fP will listen to the specified address
108for NTP broadcasts.  The default maximum wait time
109can (and probably should) be modified with \fB-t\fP.
110.TP
111.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]host\-name\f[], \f\*[B-Font]\-\-concurrent\f[]=\f\*[I-Font]host\-name\f[]
112Concurrently query all IPs returned for host-name.
113This option may appear an unlimited number of times.
114.sp
115Requests from an NTP "client" to a "server" should never be sent
116more rapidly than one every 2 seconds.  By default, any IPs returned
117as part of a DNS lookup are assumed to be for a single instance of
118\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
119one after another, with a 2-second gap in between each query.
120.sp
121The \fB-c\fP or \fB--concurrent\fP flag says that any IPs
122returned for the DNS lookup of the supplied host-name are on
123different machines, so we can send concurrent queries.
124.TP
125.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
126Increase debug verbosity level.
127This option may appear an unlimited number of times.
128.sp
129.TP
130.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
131Set the debug verbosity level.
132This option may appear an unlimited number of times.
133This option takes an integer number as its argument.
134.sp
135.TP
136.NOP \f\*[B-Font]\-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]\-\-gap\f[]=\f\*[I-Font]milliseconds\f[]
137The gap (in milliseconds) between time requests.
138This option takes an integer number as its argument.
139The default
140\f\*[I-Font]milliseconds\f[]
141for this option is:
142.ti +4
143 50
144.sp
145Since we're only going to use the first valid response we get and
146there is benefit to specifying a good number of servers to query,
147separate the queries we send out by the specified number of
148milliseconds.
149.TP
150.NOP \f\*[B-Font]\-K\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-kod\f[]=\f\*[I-Font]file\-name\f[]
151KoD history filename.
152The default
153\f\*[I-Font]file\-name\f[]
154for this option is:
155.ti +4
156 /var/db/ntp-kod
157.sp
158Specifies the filename to be used for the persistent history of KoD
159responses received from servers.
160.TP
161.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]file\-name\f[]
162Look in this file for the key specified with \fB-a\fP.
163.sp
164This option specifies the keyfile.
165\fBsntp\fP will search for the key specified with \fB-a\fP
166\fIkeyno\fP in this file.  See \fBntp.keys(5)\fP for more
167information.
168.TP
169.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]file\-name\f[]
170Log to specified logfile.
171.sp
172This option causes the client to write log messages to the specified
173\fIlogfile\fP.
174.TP
175.NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-steplimit\f[]=\f\*[I-Font]number\f[]
176Adjustments less than \fBsteplimit\fP msec will be slewed.
177This option takes an integer number as its argument.
178The value of
179\f\*[I-Font]number\f[]
180is constrained to being:
181.in +4
182.nf
183.na
184greater than or equal to 0
185.fi
186.in -4
187.sp
188If the time adjustment is less than \fIsteplimit\fP milliseconds,
189slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
190correction using \fBsettimeofday(2)\fP. 
191.TP
192.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
193Send \fBint\fP as our NTP protocol version.
194This option takes an integer number as its argument.
195The value of
196\f\*[I-Font]number\f[]
197is constrained to being:
198.in +4
199.nf
200.na
201in the range  0 through 7
202.fi
203.in -4
204The default
205\f\*[I-Font]number\f[]
206for this option is:
207.ti +4
208 4
209.sp
210When sending requests to a remote server, tell them we are running
211NTP protocol version \fIntpversion\fP .
212.TP
213.NOP \f\*[B-Font]\-r\f[], \f\*[B-Font]\-\-usereservedport\f[]
214Use the NTP Reserved Port (port 123).
215.sp
216Use port 123, which is reserved for NTP, for our network
217communications.
218.TP
219.NOP \f\*[B-Font]\-S\f[], \f\*[B-Font]\-\-step\f[]
220OK to 'step' the time with \fBsettimeofday(2)\fP.
221.sp
222.TP
223.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-slew\f[]
224OK to 'slew' the time with \fBadjtime(2)\fP.
225.sp
226.TP
227.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]\-\-timeout\f[]=\f\*[I-Font]seconds\f[]
228The number of seconds to wait for responses.
229This option takes an integer number as its argument.
230The default
231\f\*[I-Font]seconds\f[]
232for this option is:
233.ti +4
234 5
235.sp
236When waiting for a reply, \fBsntp\fP will wait the number
237of seconds specified before giving up.  The default should be
238more than enough for a unicast response.  If \fBsntp\fP is
239only waiting for a broadcast response a longer timeout is
240likely needed.
241.TP
242.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[]
243Wait for pending replies (if not setting the time).
244The \fIno\-wait\fP form will disable the option.
245This option is enabled by default.
246.sp
247If we are not setting the time, wait for all pending responses.
248.TP
249.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
250Display usage information and exit.
251.TP
252.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
253Pass the extended usage information through a pager.
254.TP
255.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
256Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
257configuration file listed in the \fBOPTION PRESETS\fP section, below.
258The command will exit after updating the config file.
259.TP
260.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
261Load options from \fIcfgfile\fP.
262The \fIno-load-opts\fP form will disable the loading
263of earlier config/rc/ini files.  \fI\-\-no-load-opts\fP is handled early,
264out of order.
265.TP
266.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
267Output version of program and exit.  The default mode is `v', a simple
268version.  The `c' mode will print copyright information and `n' will
269print the full copyright notice.
270.PP
271.SH "OPTION PRESETS"
272Any option that is not marked as \fInot presettable\fP may be preset
273by loading values from configuration ("RC" or ".INI") file(s) and values from
274environment variables named:
275.nf
276  \fBSNTP_<option-name>\fP or \fBSNTP\fP
277.fi
278.ad
279The environmental presets take precedence (are processed later than)
280the configuration files.
281The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
282If any of these are directories, then the file \fI.ntprc\fP
283is searched for within those directories.
284.TH sntp 1sntpman "24 Dec 2013" "4.2.7p404" "User Commands"
285.\"
286.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ava45X/ag-mva44X)
287.\"
288.\" It has been AutoGen-ed December 24, 2013 at 11:39:56 AM by AutoGen 5.18.3pre5
289.\" From the definitions sntp-opts.def
290.\" and the template file agman-cmd.tpl
291.SH NAME
292\f\*[B-Font]sntp\fP sntp
293\- standard Simple Network Time Protocol client program
294cvt_prog='/usr/local/gnu/share/autogen/texi2man'
295cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd
296         `/`basename "$cvt_prog"`
297cd $tmp_dir
298test \-x "$cvt_prog" || die "'$cvt_prog' is not executable"
299{
300    list='synopsis description options option-presets'
301    for f in $list ; do cat $f ; echo ; done
302    rm \-f $list name
303    list='implementation-notes environment files examples exit-status errors
304        compatibility see-also conforming-to history authors copyright bugs
305        notes'
306    for f in $list ; do cat $f ; echo ; done > .end-doc
307    rm \-f $list
308    list=`ls \-1 *`' .end-doc'
309    for f in $list ; do cat $f ; echo ; done
310    rm \-f $list
311} 1>.doc 2>/dev/null
312sed \-f .cmds .doc | /usr/local/gnu/bin/grep \-E \-v '^[ 	]*$' | $cvt_prog
313.SH USAGE
314.TP 7
315.NOP \f[C]sntp ntpserver.somewhere\f[]
316is the simplest use of this program
317and can be run as an unprivileged command
318to check the current time and error in the local clock.
319.TP 7
320.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
321With suitable privilege,
322run as a command
323or from a
324\fCcron\fR(8)\f[]
325job,
326\f\*[B-Font]sntp \-a\f[]
327will reset the local clock from a synchronized specified server,
328like the (deprecated)
329\fCntpdate\fR(1ntpdatemdoc)\f[],
330or
331\fCrdate\fR(8)\f[]
332commands.
333.PP
334.SH "ENVIRONMENT"
335See \fBOPTION PRESETS\fP for configuration environment variables.
336.SH "FILES"
337See \fBOPTION PRESETS\fP for configuration files.
338.SH "EXIT STATUS"
339One of the following exit values will be returned:
340.TP
341.NOP 0 " (EXIT_SUCCESS)"
342Successful program execution.
343.TP
344.NOP 1 " (EXIT_FAILURE)"
345The operation failed or the command syntax was not valid.
346.TP
347.NOP 66 " (EX_NOINPUT)"
348A specified configuration file could not be loaded.
349.TP
350.NOP 70 " (EX_SOFTWARE)"
351libopts had an internal operational error.  Please report
352it to autogen-users@lists.sourceforge.net.  Thank you.
353.PP
354.SH AUTHORS
355.NOP  "Johannes Maximilian Kuehn" 
356.br
357.NOP  "Harlan Stenn" 
358.br
359.NOP  "Dave Hart" 
360.br
361.SH "COPYRIGHT"
362Copyright (C) 1970-2013 The University of Delaware all rights reserved.
363This program is released under the terms of the NTP license, <http://ntp.org/license>.
364.SH "BUGS"
365Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
366.SH NOTES
367This document corresponds to version 4.2.7p404 of
368\f\*[B-Font]sntp\fP.
369.sp \n(Ppu
370.ne 2
371
372This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
373option definitions.
374