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