1275970Scy.de1 NOP 2275970Scy. it 1 an-trap 3275970Scy. if \\n[.$] \,\\$*\/ 4275970Scy.. 5275970Scy.ie t \ 6275970Scy.ds B-Font [CB] 7275970Scy.ds I-Font [CI] 8275970Scy.ds R-Font [CR] 9275970Scy.el \ 10275970Scy.ds B-Font B 11275970Scy.ds I-Font I 12275970Scy.ds R-Font R 13316722Sdelphij.TH sntp 1sntpman "21 Mar 2017" "4.2.8p10" "User Commands" 14275970Scy.\" 15316722Sdelphij.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-aQaqbX/ag-nQaiaX) 16275970Scy.\" 17316722Sdelphij.\" It has been AutoGen-ed March 21, 2017 at 10:36:45 AM by AutoGen 5.18.5 18275970Scy.\" From the definitions sntp-opts.def 19275970Scy.\" and the template file agman-cmd.tpl 20275970Scy.SH NAME 21275970Scy\f\*[B-Font]sntp\fP 22275970Scy\- standard Simple Network Time Protocol client program 23275970Scy.SH SYNOPSIS 24275970Scy\f\*[B-Font]sntp\fP 25275970Scy.\" Mixture of short (flag) options and long options 26275970Scy[\f\*[B-Font]\-flags\f[]] 27275970Scy[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] 28275970Scy[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] 29275970Scy[ hostname-or-IP ...] 30275970Scy.sp \n(Ppu 31275970Scy.ne 2 32275970Scy 33275970Scy.SH DESCRIPTION 34275970Scy\f\*[B-Font]sntp\fP 35275970Scycan be used as an SNTP client to query a NTP or SNTP server and either display 36275970Scythe time or set the local system's time (given suitable privilege). It can be 37275970Scyrun as an interactive command or from a 38275970Scy\f\*[B-Font]cron\f[] 39275970Scyjob. 40275970ScyNTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) 41275970Scyare defined and described by RFC 5905. 42275970Scy.sp \n(Ppu 43275970Scy.ne 2 44275970Scy 45275970ScyThe default is to write the estimated correct local date and time (i.e. not 46275970ScyUTC) to the standard output in a format like: 47275970Scy\f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[] 48275970Scywhere the 49275970Scy\f\*[B-Font]'(+0800)'\f[] 50275970Scymeans that to get to UTC from the reported local time one must 51275970Scyadd 8 hours and 0 minutes, 52275970Scythe 53275970Scy\f\*[B-Font]'+4.567'\f[] 54275970Scyindicates the local clock is 4.567 seconds behind the correct time 55275970Scy(so 4.567 seconds must be added to the local clock to get it to be correct). 56275970ScyNote that the number of decimals printed for this value will change 57275970Scybased on the reported precision of the server. 58275970Scy\f\*[B-Font]'+/- 0.089'\f[] 59275970Scyis the reported 60275970Scy\fIsynchronization\f[] \fIdistance\f[] 61275970Scy(in seconds), which represents the maximum error due to all causes. 62275970ScyIf the server does not report valid data needed to calculate the 63275970Scysynchronization distance, this will be reported as 64275970Scy\f\*[B-Font]'+/- ?'\f[]. 65275970ScyIf the 66275970Scy\fIhost\f[] 67275970Scyis different from the 68275970Scy\fIIP\f[], 69275970Scyboth will be displayed. 70275970ScyOtherwise, only the 71275970Scy\fIIP\f[] 72275970Scyis displayed. 73275970ScyFinally, the 74275970Scy\fIstratum\f[] 75282408Scyof the host is reported 76282408Scyand the leap indicator is decoded and displayed. 77275970Scy.SH "OPTIONS" 78275970Scy.TP 79275970Scy.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] 80275970ScyForce IPv4 DNS name resolution. 81275970ScyThis option must not appear in combination with any of the following options: 82275970Scyipv6. 83275970Scy.sp 84275970ScyForce DNS resolution of the following host names on the command line 85275970Scyto the IPv4 namespace. 86275970Scy.TP 87275970Scy.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[] 88275970ScyForce IPv6 DNS name resolution. 89275970ScyThis option must not appear in combination with any of the following options: 90275970Scyipv4. 91275970Scy.sp 92275970ScyForce DNS resolution of the following host names on the command line 93275970Scyto the IPv6 namespace. 94275970Scy.TP 95275970Scy.NOP \f\*[B-Font]\-a\f[] \f\*[I-Font]auth\-keynumber\f[], \f\*[B-Font]\-\-authentication\f[]=\f\*[I-Font]auth\-keynumber\f[] 96275970ScyEnable authentication with the key \fBauth-keynumber\fP. 97275970ScyThis option takes an integer number as its argument. 98275970Scy.sp 99275970ScyEnable authentication using the key specified in this option's 100275970Scyargument. The argument of this option is the \fBkeyid\fP, a 101275970Scynumber specified in the \fBkeyfile\fP as this key's identifier. 102275970ScySee the \fBkeyfile\fP option (\fB-k\fP) for more details. 103275970Scy.TP 104275970Scy.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]broadcast\-address\f[], \f\*[B-Font]\-\-broadcast\f[]=\f\*[I-Font]broadcast\-address\f[] 105275970ScyListen to the address specified for broadcast time sync. 106275970ScyThis option may appear an unlimited number of times. 107275970Scy.sp 108275970ScyIf specified \fBsntp\fP will listen to the specified address 109275970Scyfor NTP broadcasts. The default maximum wait time 110275970Scycan (and probably should) be modified with \fB-t\fP. 111275970Scy.TP 112275970Scy.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]host\-name\f[], \f\*[B-Font]\-\-concurrent\f[]=\f\*[I-Font]host\-name\f[] 113275970ScyConcurrently query all IPs returned for host-name. 114275970ScyThis option may appear an unlimited number of times. 115275970Scy.sp 116275970ScyRequests from an NTP "client" to a "server" should never be sent 117275970Scymore rapidly than one every 2 seconds. By default, any IPs returned 118275970Scyas part of a DNS lookup are assumed to be for a single instance of 119275970Scy\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs 120275970Scyone after another, with a 2-second gap in between each query. 121275970Scy.sp 122275970ScyThe \fB-c\fP or \fB--concurrent\fP flag says that any IPs 123275970Scyreturned for the DNS lookup of the supplied host-name are on 124275970Scydifferent machines, so we can send concurrent queries. 125275970Scy.TP 126275970Scy.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[] 127275970ScyIncrease debug verbosity level. 128275970ScyThis option may appear an unlimited number of times. 129275970Scy.sp 130275970Scy.TP 131275970Scy.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[] 132275970ScySet the debug verbosity level. 133275970ScyThis option may appear an unlimited number of times. 134275970ScyThis option takes an integer number as its argument. 135275970Scy.sp 136275970Scy.TP 137275970Scy.NOP \f\*[B-Font]\-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]\-\-gap\f[]=\f\*[I-Font]milliseconds\f[] 138275970ScyThe gap (in milliseconds) between time requests. 139275970ScyThis option takes an integer number as its argument. 140275970ScyThe default 141275970Scy\f\*[I-Font]milliseconds\f[] 142275970Scyfor this option is: 143275970Scy.ti +4 144275970Scy 50 145275970Scy.sp 146275970ScySince we're only going to use the first valid response we get and 147275970Scythere is benefit to specifying a good number of servers to query, 148275970Scyseparate the queries we send out by the specified number of 149275970Scymilliseconds. 150275970Scy.TP 151275970Scy.NOP \f\*[B-Font]\-K\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-kod\f[]=\f\*[I-Font]file\-name\f[] 152275970ScyKoD history filename. 153275970ScyThe default 154275970Scy\f\*[I-Font]file\-name\f[] 155275970Scyfor this option is: 156275970Scy.ti +4 157275970Scy /var/db/ntp-kod 158275970Scy.sp 159275970ScySpecifies the filename to be used for the persistent history of KoD 160275970Scyresponses received from servers. If the file does not exist, a 161275970Scywarning message will be displayed. The file will not be created. 162275970Scy.TP 163275970Scy.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]file\-name\f[] 164275970ScyLook in this file for the key specified with \fB-a\fP. 165275970Scy.sp 166275970ScyThis option specifies the keyfile. 167275970Scy\fBsntp\fP will search for the key specified with \fB-a\fP 168275970Scy\fIkeyno\fP in this file. See \fBntp.keys(5)\fP for more 169275970Scyinformation. 170275970Scy.TP 171275970Scy.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]file\-name\f[] 172275970ScyLog to specified logfile. 173275970Scy.sp 174275970ScyThis option causes the client to write log messages to the specified 175275970Scy\fIlogfile\fP. 176275970Scy.TP 177275970Scy.NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-steplimit\f[]=\f\*[I-Font]number\f[] 178275970ScyAdjustments less than \fBsteplimit\fP msec will be slewed. 179275970ScyThis option takes an integer number as its argument. 180275970ScyThe value of 181275970Scy\f\*[I-Font]number\f[] 182275970Scyis constrained to being: 183275970Scy.in +4 184275970Scy.nf 185275970Scy.na 186275970Scygreater than or equal to 0 187275970Scy.fi 188275970Scy.in -4 189275970Scy.sp 190275970ScyIf the time adjustment is less than \fIsteplimit\fP milliseconds, 191275970Scyslew the amount using \fBadjtime(2)\fP. Otherwise, step the 192280849Scycorrection using \fBsettimeofday(2)\fP. The default value is 0, 193280849Scywhich means all adjustments will be stepped. This is a feature, as 194280849Scydifferent situations demand different values. 195275970Scy.TP 196275970Scy.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[] 197275970ScySend \fBint\fP as our NTP protocol version. 198275970ScyThis option takes an integer number as its argument. 199275970ScyThe value of 200275970Scy\f\*[I-Font]number\f[] 201275970Scyis constrained to being: 202275970Scy.in +4 203275970Scy.nf 204275970Scy.na 205275970Scyin the range 0 through 7 206275970Scy.fi 207275970Scy.in -4 208275970ScyThe default 209275970Scy\f\*[I-Font]number\f[] 210275970Scyfor this option is: 211275970Scy.ti +4 212275970Scy 4 213275970Scy.sp 214275970ScyWhen sending requests to a remote server, tell them we are running 215275970ScyNTP protocol version \fIntpversion\fP . 216275970Scy.TP 217275970Scy.NOP \f\*[B-Font]\-r\f[], \f\*[B-Font]\-\-usereservedport\f[] 218275970ScyUse the NTP Reserved Port (port 123). 219275970Scy.sp 220275970ScyUse port 123, which is reserved for NTP, for our network 221275970Scycommunications. 222275970Scy.TP 223275970Scy.NOP \f\*[B-Font]\-S\f[], \f\*[B-Font]\-\-step\f[] 224275970ScyOK to 'step' the time with \fBsettimeofday(2)\fP. 225275970Scy.sp 226275970Scy.TP 227275970Scy.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-slew\f[] 228275970ScyOK to 'slew' the time with \fBadjtime(2)\fP. 229275970Scy.sp 230275970Scy.TP 231275970Scy.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]\-\-timeout\f[]=\f\*[I-Font]seconds\f[] 232275970ScyThe number of seconds to wait for responses. 233275970ScyThis option takes an integer number as its argument. 234275970ScyThe default 235275970Scy\f\*[I-Font]seconds\f[] 236275970Scyfor this option is: 237275970Scy.ti +4 238275970Scy 5 239275970Scy.sp 240275970ScyWhen waiting for a reply, \fBsntp\fP will wait the number 241275970Scyof seconds specified before giving up. The default should be 242275970Scymore than enough for a unicast response. If \fBsntp\fP is 243275970Scyonly waiting for a broadcast response a longer timeout is 244275970Scylikely needed. 245275970Scy.TP 246275970Scy.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[] 247275970ScyWait for pending replies (if not setting the time). 248275970ScyThe \fIno\-wait\fP form will disable the option. 249275970ScyThis option is enabled by default. 250275970Scy.sp 251275970ScyIf we are not setting the time, wait for all pending responses. 252275970Scy.TP 253275970Scy.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] 254275970ScyDisplay usage information and exit. 255275970Scy.TP 256275970Scy.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] 257275970ScyPass the extended usage information through a pager. 258275970Scy.TP 259275970Scy.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] 260275970ScySave the option state to \fIcfgfile\fP. The default is the \fIlast\fP 261275970Scyconfiguration file listed in the \fBOPTION PRESETS\fP section, below. 262275970ScyThe command will exit after updating the config file. 263275970Scy.TP 264275970Scy.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[] 265275970ScyLoad options from \fIcfgfile\fP. 266275970ScyThe \fIno-load-opts\fP form will disable the loading 267275970Scyof earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early, 268275970Scyout of order. 269275970Scy.TP 270275970Scy.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}] 271275970ScyOutput version of program and exit. The default mode is `v', a simple 272275970Scyversion. The `c' mode will print copyright information and `n' will 273275970Scyprint the full copyright notice. 274275970Scy.PP 275275970Scy.SH "OPTION PRESETS" 276275970ScyAny option that is not marked as \fInot presettable\fP may be preset 277275970Scyby loading values from configuration ("RC" or ".INI") file(s) and values from 278275970Scyenvironment variables named: 279275970Scy.nf 280275970Scy \fBSNTP_<option-name>\fP or \fBSNTP\fP 281275970Scy.fi 282275970Scy.ad 283275970ScyThe environmental presets take precedence (are processed later than) 284275970Scythe configuration files. 285275970ScyThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 286275970ScyIf any of these are directories, then the file \fI.ntprc\fP 287275970Scyis searched for within those directories. 288275970Scy.SH USAGE 289275970Scy.TP 7 290275970Scy.NOP \f[C]sntp ntpserver.somewhere\f[] 291275970Scyis the simplest use of this program 292275970Scyand can be run as an unprivileged command 293275970Scyto check the current time and error in the local clock. 294275970Scy.TP 7 295280849Scy.NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[] 296275970ScyWith suitable privilege, 297275970Scyrun as a command 298275970Scyor from a 299285169Scy\fCcron\f[]\fR(8)\f[] 300275970Scyjob, 301280849Scy\f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[] 302280849Scywill request the time from the server, 303280849Scyand if that server reports that it is synchronized 304280849Scythen if the offset adjustment is less than 128 milliseconds 305280849Scythe correction will be slewed, 306280849Scyand if the correction is more than 128 milliseconds 307280849Scythe correction will be stepped. 308280849Scy.TP 7 309280849Scy.NOP \f[C]sntp \-S ntpserver.somewhere\f[] 310280849ScyWith suitable privilege, 311280849Scyrun as a command 312280849Scyor from a 313285169Scy\fCcron\f[]\fR(8)\f[] 314280849Scyjob, 315280849Scy\f\*[B-Font]sntp \-S ntpserver.somewhere\f[] 316280849Scywill set (step) the local clock from a synchronized specified server, 317275970Scylike the (deprecated) 318285169Scy\fCntpdate\f[]\fR(1ntpdatemdoc)\f[], 319275970Scyor 320285169Scy\fCrdate\f[]\fR(8)\f[] 321275970Scycommands. 322275970Scy.PP 323275970Scy.SH "ENVIRONMENT" 324275970ScySee \fBOPTION PRESETS\fP for configuration environment variables. 325275970Scy.SH "FILES" 326275970ScySee \fBOPTION PRESETS\fP for configuration files. 327275970Scy.SH "EXIT STATUS" 328275970ScyOne of the following exit values will be returned: 329275970Scy.TP 330275970Scy.NOP 0 " (EXIT_SUCCESS)" 331275970ScySuccessful program execution. 332275970Scy.TP 333275970Scy.NOP 1 " (EXIT_FAILURE)" 334275970ScyThe operation failed or the command syntax was not valid. 335275970Scy.TP 336275970Scy.NOP 66 " (EX_NOINPUT)" 337275970ScyA specified configuration file could not be loaded. 338275970Scy.TP 339275970Scy.NOP 70 " (EX_SOFTWARE)" 340275970Scylibopts had an internal operational error. Please report 341275970Scyit to autogen-users@lists.sourceforge.net. Thank you. 342275970Scy.PP 343275970Scy.SH AUTHORS 344275970Scy.NOP "Johannes Maximilian Kuehn" 345275970Scy.br 346275970Scy.NOP "Harlan Stenn" 347275970Scy.br 348275970Scy.NOP "Dave Hart" 349275970Scy.br 350275970Scy.SH "COPYRIGHT" 351316722SdelphijCopyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved. 352275970ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>. 353275970Scy.SH "BUGS" 354275970ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org 355275970Scy.SH "NOTES" 356275970ScyThis manual page was \fIAutoGen\fP-erated from the \fBsntp\fP 357275970Scyoption definitions. 358