1 .TH SNTP 1 2009-12-10 "( 4.2.6)" "Programmer's Manual"
2 .\" EDIT THIS FILE WITH CAUTION (sntp.1)
4 .\" It has been AutoGen-ed December 10, 2009 at 05:07:54 AM by AutoGen 5.10
5 .\" From the definitions sntp-opts.def
6 .\" and the template file agman1.tpl
9 sntp \- standard SNTP program
12 .\" Mixture of short (flag) options and long options
13 .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
18 This manual page briefly documents the \fBsntp\fP command.
20 can be used as a SNTP client to query a NTP or SNTP server and either display
21 the time or set the local system's time (given suitable privilege). It can be
22 run as an interactive command or in a
26 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
27 are defined and described by
28 draft-ietf-ntp-ntpv4-proto-13,
29 which should become a full RFC any month now.
32 The default is to write the estimated correct local date and time (i.e. not
33 UTC) to the standard output in a format like
34 .BR "'1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs'" ,
36 .B "'+4.567 +/- 0.089 secs'"
37 indicates the local clock is 4.567 seconds behind the correct time
38 (so 4.567 seconds must be added to the local clock to get it to be correct),
40 '1996 Oct 15 20:17:25.123'
41 is believed to be correct to within
47 Force IPv4 DNS name resolution.
48 This option must not appear in combination with any of the following options:
51 Force DNS resolution of following host names on the command line
52 to the IPv4 namespace.
55 Force IPv6 DNS name resolution.
56 This option must not appear in combination with any of the following options:
59 Force DNS resolution of following host names on the command line
60 to the IPv6 namespace.
62 .BR \-d ", " \--normalverbose
65 Diagnostic messages for non-fatal errors and a limited amount of
66 tracing should be written to standard error. Fatal ones always
67 produce a diagnostic. This option should be set when there is a
68 suspected problem with the server, network or the source.
70 .BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP
73 Modifies the filename to be used to persist the history of KoD
74 responses received from servers. The default is
77 .BR \-p ", " \--syslog
79 This option must not appear in combination with any of the following options:
82 When this option is set all logging will be done using syslog.
84 .BR \-l " \fIfile-name\fP, " \--filelog "=" \fIfile-name\fP
85 Log to specified logfile.
86 This option must not appear in combination with any of the following options:
89 This option causes the client to write log messages to the specified
92 .BR \-s ", " \--settod
93 Set (step) the time with settimeofday().
94 This option must not appear in combination with any of the following options:
99 .BR \-j ", " \--adjtime
100 Set (slew) the time with adjtime().
101 This option must not appear in combination with any of the following options:
106 .BR \-b " \fIbroadcast-address\fP, " \--broadcast "=" \fIbroadcast-address\fP
107 Use broadcasts to the address specified for synchronisation.
109 If specified SNTP will listen to the specified broadcast address
110 for NTP broadcasts. The default maximum wait time,
111 68 seconds, can be modified with \-t.
113 .BR \-t " \fIseconds\fP, " \--timeout "=" \fIseconds\fP
114 Specify the number of seconds to wait for broadcasts.
115 This option takes an integer number as its argument.
116 The default \fIseconds\fP for this option is:
120 When waiting for a broadcast packet SNTP will wait the number
121 of seconds specified before giving up. Default 68 seconds.
123 .BR \-a " \fIauth-keynumber\fP, " \--authentication "=" \fIauth-keynumber\fP
124 Enable authentication with the key auth-keynumber.
125 This option takes an integer number as its argument.
127 This option enables authentication using the key specified in this option's argument.
128 The argument of this option is the keyid, a number specified in the keyfile as this
129 key's identifier. See the keyfile option (-k) for more details.
131 .BR \-k " \fIfile-name\fP, " \--keyfile "=" \fIfile-name\fP
132 Specify a keyfile. SNTP will look in this file for the key specified with \-a.
134 This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this
135 file. Key files follow the following format:
139 Where keyid is a number identifying this key
140 keytype is one of the follow:
141 S Key in 64 Bit hexadecimal number as specified in in the DES specification.
142 N Key in 64 Bit hexadecimal number as specified in the NTP standard.
143 A Key in a 1-to-8 character ASCII string.
144 M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.
146 For more information see ntp.keys(5).
149 Display extended usage information and exit.
151 .BR \-! , " \--more-help"
152 Extended usage information passed thru pager.
154 .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
155 Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
156 configuration file listed in the \fBOPTION PRESETS\fP section, below.
158 .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
159 Load options from \fIrcfile\fP.
160 The \fIno-load-opts\fP form will disable the loading
161 of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
164 .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
165 Output version of program and exit. The default mode is `v', a simple
166 version. The `c' mode will print copyright information and `n' will
167 print the full copyright notice.
169 Any option that is not marked as \fInot presettable\fP may be preset
170 by loading values from configuration ("RC" or ".INI") file(s) and values from
171 environment variables named:
173 \fBSNTP_<option-name>\fP or \fBSNTP\fP
176 The environmental presets take precedence (are processed later than)
177 the configuration files.
178 The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
179 If any of these are directories, then the file \fI.ntprc\fP
180 is searched for within those directories.
182 The simplest use of this program is as an unprivileged command to check the
183 current time and error in the local clock. For example:
185 .B sntp ntpserver.somewhere
187 With suitable privilege, it can be run as a command or in a
189 job to reset the local clock from a reliable server, like the
193 commands. For example:
195 .B sntp \-a ntpserver.somewhere
197 The program returns a zero exit
198 status for success, and a non-zero one otherwise.
200 Please report bugs to http://bugs.ntp.org .
202 David L. Mills and/or others
204 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
209 see html/copyright.html
213 This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP