File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / sntp / sntp.1
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 5 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

.TH SNTP 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual"
.\"  EDIT THIS FILE WITH CAUTION  (sntp.1)
.\"  
.\"  It has been AutoGen-ed  December 24, 2011 at 06:33:59 PM by AutoGen 5.12
.\"  From the definitions    sntp-opts.def
.\"  and the template file   agman1.tpl
.\"
.SH NAME
sntp \- standard Simple Network Time Protocol program
.SH SYNOPSIS
.B sntp
.\" Mixture of short (flag) options and long options
.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
.br
.in +8
[ hostname-or-IP ...]
.PP

.SH "DESCRIPTION"
This manual page briefly documents the \fBsntp\fP command.
.I sntp
can be used as a 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 in a
.I cron
job.

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
are defined and described by RFC 5905.

.PP
The default is to write the estimated correct local date and time (i.e. not
UTC) to the standard output in a format like
.BR "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs'" ,
where the
.B "'(+0800)'"
means that to get to UTC from the reported local time one must
add 8 hours and 0 minutes,
and the
.B "'+4.567 +/- 0.089 secs'"
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),
and the time of
'1996-10-15 20:17:25.123'
is believed to be correct to within
+/- 0.089
seconds.
.SH OPTIONS
.TP
.BR \-4 ", " \--ipv4
Force IPv4 DNS name resolution.
This option must not appear in combination with any of the following options:
ipv6.
.sp
Force DNS resolution of the following host names on the command line
to the IPv4 namespace.
.TP
.BR \-6 ", " \--ipv6
Force IPv6 DNS name resolution.
This option must not appear in combination with any of the following options:
ipv4.
.sp
Force DNS resolution of the following host names on the command line
to the IPv6 namespace.
.TP
.BR \-d ", " \--normalverbose
Normal verbose.
.sp
Diagnostic messages for non-fatal errors and a limited amount of
tracing should be written to standard error.  Fatal ones always
produce a diagnostic.  This option should be set when there is a
suspected problem with the server, network or the source.
.TP
.BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP
KoD history filename.
.sp
Specifies the filename to be used to persist the history of KoD
responses received from servers.  The default is
/var/db/ntp-kod.
.TP
.BR \-p ", " \--syslog
Logging with syslog.
This option must not appear in combination with any of the following options:
logfile.
.sp
When this option is set all logging will be done using syslog.
.TP
.BR \-l " \fIfile-name\fP, " \--logfile "=" \fIfile-name\fP
Log to specified logfile.
This option must not appear in combination with any of the following options:
syslog.
.sp
This option causes the client to write log messages to the specified
logfile.
.TP
.BR \-s ", " \--settod
Set (step) the time with settimeofday().
This option must not appear in combination with any of the following options:
adjtime.
.sp

.TP
.BR \-j ", " \--adjtime
Set (slew) the time with adjtime().
This option must not appear in combination with any of the following options:
settod.
.sp

.TP
.BR \-b " \fIbroadcast-address\fP, " \--broadcast "=" \fIbroadcast-address\fP
Use broadcasts to the address specified for synchronisation.
.sp
If specified SNTP will listen to the specified broadcast address
for NTP broadcasts.  The default maximum wait time,
68 seconds, can be modified with \-t.
.TP
.BR \-t " \fIseconds\fP, " \--timeout "=" \fIseconds\fP
Specify the number of seconds to wait for broadcasts.
This option takes an integer number as its argument.
The default \fIseconds\fP for this option is:
.ti +4
 68
.sp
When waiting for a broadcast packet SNTP will wait the number
of seconds specified before giving up.  Default 68 seconds.
.TP
.BR \-a " \fIauth-keynumber\fP, " \--authentication "=" \fIauth-keynumber\fP
Enable authentication with the key auth-keynumber.
This option takes an integer number as its argument.
.sp
This option enables 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.
.TP
.BR \-k " \fIfile-name\fP, " \--keyfile "=" \fIfile-name\fP
Specify a keyfile. SNTP will look in this file for the key specified with \-a.
.sp
This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this
file. Key files follow the following format:

keyid keytype key

Where	keyid is a number identifying this key
keytype is one of the follow:
S  Key in 64 Bit hexadecimal number as specified in in the DES specification.
N  Key in 64 Bit hexadecimal number as specified in the NTP standard.
A  Key in a 1-to-8 character ASCII string.
M  Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.

For more information see ntp.keys(5).
.TP
.BR \-? , " \--help"
Display extended usage information and exit.
.TP
.BR \-! , " \--more-help"
Extended usage information passed thru pager.
.TP
.BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
Save the option state to \fIrcfile\fP.  The default is the \fIlast\fP
configuration file listed in the \fBOPTION PRESETS\fP section, below.
.TP
.BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
Load options from \fIrcfile\fP.
The \fIno-load-opts\fP form will disable the loading
of earlier RC/INI files.  \fI--no-load-opts\fP is handled early,
out of order.
.TP
.BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
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.
.SH OPTION PRESETS
Any option that is not marked as \fInot presettable\fP may be preset
by loading values from configuration ("RC" or ".INI") file(s) and values from
environment variables named:
.nf
  \fBSNTP_<option-name>\fP or \fBSNTP\fP
.fi
.ad
The environmental presets take precedence (are processed later than)
the configuration files.
The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
.SH USAGE
The simplest use of this program is as an unprivileged command to check the
current time and error in the local clock.  For example:
.IP
.B sntp ntpserver.somewhere
.PP
With suitable privilege, it can be run as a command or in a
.I cron
job to reset the local clock from a reliable server, like the
.I ntpdate
and
.I rdate
commands.  For example:
.IP
.B sntp \-a ntpserver.somewhere
.SH RETURN VALUE
The program returns a zero exit
status for success, and a non-zero one otherwise.
.SH BUGS
Please report bugs to http://bugs.ntp.org .
.SH AUTHOR
David L. Mills and/or others
.br
Please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org

.PP
.nf
.na
see html/copyright.html

.fi
.ad
.PP
This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
option definitions.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>