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