xref: /freebsd/contrib/ntp/sntp/sntp.1sntpman (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
. it 1 an-trap . if \\n[.$] \,\\$*\/ ..
sntp 1sntpman "20 Jan 2016" "4.2.8p6" "User Commands"

EDIT THIS FILE WITH CAUTION (/tmp/.ag-vxaitn/ag-Ixaasn)

It has been AutoGen-ed January 20, 2016 at 04:06:38 AM by AutoGen 5.18.5
From the definitions sntp-opts.def
and the template file agman-cmd.tpl
NAME
\f\*[B-Font]sntp - standard Simple Network Time Protocol client program
SYNOPSIS
\f\*[B-Font]sntp Mixture of short (flag) options and long options
[\f\*[B-Font]-flags\f[]] [\f\*[B-Font]-flag\f[] [\f\*[I-Font]value\f[]]] [\f\*[B-Font]--option-name\f[][[=| ]\f\*[I-Font]value\f[]]] [ hostname-or-IP ...]
DESCRIPTION
\f\*[B-Font]sntp can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or from a \f\*[B-Font]cron\f[] job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like: \f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[] where the \f\*[B-Font]'(+0800)'\f[] means that to get to UTC from the reported local time one must add 8 hours and 0 minutes, the \f\*[B-Font]'+4.567'\f[] indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct). Note that the number of decimals printed for this value will change based on the reported precision of the server. \f\*[B-Font]'+/- 0.089'\f[] is the reported synchronization\f[] distance\f[] (in seconds), which represents the maximum error due to all causes. If the server does not report valid data needed to calculate the synchronization distance, this will be reported as \f\*[B-Font]'+/- ?'\f[]. If the host\f[] is different from the IP\f[], both will be displayed. Otherwise, only the IP\f[] is displayed. Finally, the stratum\f[] of the host is reported and the leap indicator is decoded and displayed.
"OPTIONS"

.NOP \f\*[B-Font]-4\f[], \f\*[B-Font]--ipv4\f[] Force IPv4 DNS name resolution. This option must not appear in combination with any of the following options: ipv6. Force DNS resolution of the following host names on the command line to the IPv4 namespace.

.NOP \f\*[B-Font]-6\f[], \f\*[B-Font]--ipv6\f[] Force IPv6 DNS name resolution. This option must not appear in combination with any of the following options: ipv4. Force DNS resolution of the following host names on the command line to the IPv6 namespace.

.NOP \f\*[B-Font]-a\f[] \f\*[I-Font]auth-keynumber\f[], \f\*[B-Font]--authentication\f[]=\f\*[I-Font]auth-keynumber\f[] Enable authentication with the key auth-keynumber. This option takes an integer number as its argument. Enable authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the keyfile option (-k) for more details.

.NOP \f\*[B-Font]-b\f[] \f\*[I-Font]broadcast-address\f[], \f\*[B-Font]--broadcast\f[]=\f\*[I-Font]broadcast-address\f[] Listen to the address specified for broadcast time sync. This option may appear an unlimited number of times. If specified sntp will listen to the specified address for NTP broadcasts. The default maximum wait time can (and probably should) be modified with -t.

.NOP \f\*[B-Font]-c\f[] \f\*[I-Font]host-name\f[], \f\*[B-Font]--concurrent\f[]=\f\*[I-Font]host-name\f[] Concurrently query all IPs returned for host-name. This option may appear an unlimited number of times. Requests from an NTP "client" to a "server" should never be sent more rapidly than one every 2 seconds. By default, any IPs returned as part of a DNS lookup are assumed to be for a single instance of ntpd, and therefore sntp will send queries to these IPs one after another, with a 2-second gap in between each query. The -c or --concurrent flag says that any IPs returned for the DNS lookup of the supplied host-name are on different machines, so we can send concurrent queries.

.NOP \f\*[B-Font]-d\f[], \f\*[B-Font]--debug-level\f[] Increase debug verbosity level. This option may appear an unlimited number of times.

.NOP \f\*[B-Font]-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]--set-debug-level\f[]=\f\*[I-Font]number\f[] Set the debug verbosity level. This option may appear an unlimited number of times. This option takes an integer number as its argument.

.NOP \f\*[B-Font]-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]--gap\f[]=\f\*[I-Font]milliseconds\f[] The gap (in milliseconds) between time requests. This option takes an integer number as its argument. The default \f\*[I-Font]milliseconds\f[] for this option is: 50 Since we're only going to use the first valid response we get and there is benefit to specifying a good number of servers to query, separate the queries we send out by the specified number of milliseconds.

.NOP \f\*[B-Font]-K\f[] \f\*[I-Font]file-name\f[], \f\*[B-Font]--kod\f[]=\f\*[I-Font]file-name\f[] KoD history filename. The default \f\*[I-Font]file-name\f[] for this option is: /var/db/ntp-kod Specifies the filename to be used for the persistent history of KoD responses received from servers. If the file does not exist, a warning message will be displayed. The file will not be created.

.NOP \f\*[B-Font]-k\f[] \f\*[I-Font]file-name\f[], \f\*[B-Font]--keyfile\f[]=\f\*[I-Font]file-name\f[] Look in this file for the key specified with -a. This option specifies the keyfile. sntp will search for the key specified with -a keyno in this file. See ntp.keys(5) for more information.

.NOP \f\*[B-Font]-l\f[] \f\*[I-Font]file-name\f[], \f\*[B-Font]--logfile\f[]=\f\*[I-Font]file-name\f[] Log to specified logfile. This option causes the client to write log messages to the specified logfile.

.NOP \f\*[B-Font]-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]--steplimit\f[]=\f\*[I-Font]number\f[] Adjustments less than steplimit msec will be slewed. This option takes an integer number as its argument. The value of \f\*[I-Font]number\f[] is constrained to being:

greater than or equal to 0
If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(2). Otherwise, step the correction using settimeofday(2). The default value is 0, which means all adjustments will be stepped. This is a feature, as different situations demand different values.

.NOP \f\*[B-Font]-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]--ntpversion\f[]=\f\*[I-Font]number\f[] Send int as our NTP protocol version. This option takes an integer number as its argument. The value of \f\*[I-Font]number\f[] is constrained to being:

in the range 0 through 7
The default \f\*[I-Font]number\f[] for this option is: 4 When sending requests to a remote server, tell them we are running NTP protocol version ntpversion .

.NOP \f\*[B-Font]-r\f[], \f\*[B-Font]--usereservedport\f[] Use the NTP Reserved Port (port 123). Use port 123, which is reserved for NTP, for our network communications.

.NOP \f\*[B-Font]-S\f[], \f\*[B-Font]--step\f[] OK to 'step' the time with settimeofday(2).

.NOP \f\*[B-Font]-s\f[], \f\*[B-Font]--slew\f[] OK to 'slew' the time with adjtime(2).

.NOP \f\*[B-Font]-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]--timeout\f[]=\f\*[I-Font]seconds\f[] The number of seconds to wait for responses. This option takes an integer number as its argument. The default \f\*[I-Font]seconds\f[] for this option is: 5 When waiting for a reply, sntp will wait the number of seconds specified before giving up. The default should be more than enough for a unicast response. If sntp is only waiting for a broadcast response a longer timeout is likely needed.

.NOP \f\*[B-Font]--wait\f[], \f\*[B-Font]- Fl -no-wait\f[] Wait for pending replies (if not setting the time). The no-wait form will disable the option. This option is enabled by default. If we are not setting the time, wait for all pending responses.

.NOP \f\*[B-Font]-?\f[], \f\*[B-Font]--help\f[] Display usage information and exit.

.NOP \f\*[B-Font]-!\f[], \f\*[B-Font]--more-help\f[] Pass the extended usage information through a pager.

.NOP \f\*[B-Font]->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]--save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] Save the option state to cfgfile. The default is the last configuration file listed in the OPTION PRESETS section, below. The command will exit after updating the config file.

.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[] Load options from cfgfile. The no-load-opts form will disable the loading of earlier config/rc/ini files. --no-load-opts is handled early, out of order.

.NOP \f\*[B-Font]--version\f[] [{\f\*[I-Font]v|c|n\f[]}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice.

"OPTION PRESETS"
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named:
 SNTP_<option-name> or SNTP
The environmental presets take precedence (are processed later than) the configuration files. The homerc files are "$HOME", and ".". If any of these are directories, then the file .ntprc is searched for within those directories.
USAGE

7 .NOP \f[C]sntp ntpserver.somewhere\f[] is the simplest use of this program and can be run as an unprivileged command to check the current time and error in the local clock.

7 .NOP \f[C]sntp -Ss -M 128 ntpserver.somewhere\f[] With suitable privilege, run as a command or from a cron\f[](8)\f[] job, \f\*[B-Font]sntp -Ss -M 128 ntpserver.somewhere\f[] will request the time from the server, and if that server reports that it is synchronized then if the offset adjustment is less than 128 milliseconds the correction will be slewed, and if the correction is more than 128 milliseconds the correction will be stepped.

7 .NOP \f[C]sntp -S ntpserver.somewhere\f[] With suitable privilege, run as a command or from a cron\f[](8)\f[] job, \f\*[B-Font]sntp -S ntpserver.somewhere\f[] will set (step) the local clock from a synchronized specified server, like the (deprecated) ntpdate\f[](1ntpdatemdoc)\f[], or rdate\f[](8)\f[] commands.

"ENVIRONMENT"
See OPTION PRESETS for configuration environment variables.
"FILES"
See OPTION PRESETS for configuration files.
"EXIT STATUS"
One of the following exit values will be returned:

.NOP 0 " (EXIT_SUCCESS)" Successful program execution.

.NOP 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid.

.NOP 66 " (EX_NOINPUT)" A specified configuration file could not be loaded.

.NOP 70 " (EX_SOFTWARE)" libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.

AUTHORS
.NOP "Johannes Maximilian Kuehn"

.NOP "Harlan Stenn"

.NOP "Dave Hart"

"COPYRIGHT"
Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>.
"BUGS"
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
"NOTES"
This manual page was AutoGen-erated from the sntp option definitions.