1SNTP(8)                       Programmer's Manual                      SNTP(8)
2
3
4

NAME

6       sntp - standard Simple Network Time Protocol program
7

SYNOPSIS

9       sntp [-flag [value]]... [--opt-name [[=| ]value]]...
10               [ hostname-or-IP ...]
11

DESCRIPTION

13       This  manual page briefly documents the sntp command.  sntp can be used
14       as a SNTP client to query a NTP or SNTP server and either  display  the
15       time or set the local system's time (given suitable privilege).  It can
16       be run as an interactive command or in a cron job.
17
18       NTP (the Network Time Protocol) and SNTP (the Simple Network Time  Pro‐
19       tocol) are defined and described by RFC 5905.
20
21
22       The default is to write the estimated correct local date and time (i.e.
23       not  UTC)  to  the  standard  output  in  a  format  like   '1996-10-15
24       20:17:25.123  (+0800) +4.567 +/- 0.089 secs', where the '(+0800)' means
25       that to get to UTC from the reported local time one must  add  8  hours
26       and  0  minutes,  and  the  '+4.567 +/- 0.089 secs' indicates the local
27       clock is 4.567 seconds behind the correct time (so 4.567  seconds  must
28       be  added  to the local clock to get it to be correct), and the time of
29       is believed to be correct to within +/- 0.089 seconds.
30

OPTIONS

32       -4, --ipv4
33              Force IPv4 DNS name resolution.  This option must not appear  in
34              combination with any of the following options: ipv6.
35
36              Force  DNS resolution of the following host names on the command
37              line to the IPv4 namespace.
38
39       -6, --ipv6
40              Force IPv6 DNS name resolution.  This option must not appear  in
41              combination with any of the following options: ipv4.
42
43              Force  DNS resolution of the following host names on the command
44              line to the IPv6 namespace.
45
46       -d, --normalverbose
47              Normal verbose.
48
49              Diagnostic messages for non-fatal errors and a limited amount of
50              tracing  should be written to standard error.  Fatal ones always
51              produce a diagnostic.  This option should be set when there is a
52              suspected problem with the server, network or the source.
53
54       -K file-name, --kod=file-name
55              KoD history filename.
56
57              Specifies  the filename to be used to persist the history of KoD
58              responses   received   from    servers.     The    default    is
59              /var/lib/sntp/kod.
60
61       -p, --syslog
62              Logging with syslog.  This option must not appear in combination
63              with any of the following options: logfile.
64
65              When this option is set all logging will be done using syslog.
66
67       -l file-name, --logfile=file-name
68              Log to specified logfile.  This option must not appear in combi‐
69              nation with any of the following options: syslog.
70
71              This option causes the client to write log messages to the spec‐
72              ified logfile.
73
74       -s, --settod
75              Set (step) the time with settimeofday().  This option  must  not
76              appear  in  combination  with any of the following options: adj‐
77              time.
78
79
80
81       -j, --adjtime
82              Set (slew) the time with adjtime().  This option must not appear
83              in combination with any of the following options: settod.
84
85
86
87       -b broadcast-address, --broadcast=broadcast-address
88              Use broadcasts to the address specified for synchronisation.
89
90              If specified SNTP will listen to the specified broadcast address
91              for NTP broadcasts.  The default maximum wait time, 68  seconds,
92              can be modified with -t.
93
94       -t seconds, --timeout=seconds
95              Specify  the  number  of  seconds  to wait for broadcasts.  This
96              option takes an integer number as  its  argument.   The  default
97              seconds for this option is:
98                   68
99
100              When waiting for a broadcast packet SNTP will wait the number of
101              seconds specified before giving up.  Default 68 seconds.
102
103       -a auth-keynumber, --authentication=auth-keynumber
104              Enable authentication with the key auth-keynumber.  This  option
105              takes an integer number as its argument.
106
107              This  option  enables  authentication using the key specified in
108              this option's argument.  The argument  of  this  option  is  the
109              keyid,  a  number specified in the keyfile as this key's identi‐
110              fier. See the keyfile option (-k) for more details.
111
112       -k file-name, --keyfile=file-name
113              Specify a keyfile. SNTP will look in this file for the key spec‐
114              ified with -a.
115
116              This  option specifies the keyfile. SNTP will search for the key
117              specified with -a keyno in this file. Key files follow the  fol‐
118              lowing format:
119
120              keyid keytype key
121
122              Where     keyid  is a number identifying this key keytype is one
123              of the follow: S  Key in 64 Bit hexadecimal number as  specified
124              in  in the DES specification.  N  Key in 64 Bit hexadecimal num‐
125              ber as specified in the NTP standard.  A  Key in a 1-to-8  char‐
126              acter  ASCII  string.  M  Key in a 1-to-8 character ASCII string
127              using the MD5 authentication scheme.
128
129              For more information see ntp.keys(5).
130
131       -?, --help
132              Display extended usage information and exit.
133
134       -!, --more-help
135              Extended usage information passed thru pager.
136
137       -> [rcfile], --save-opts[=rcfile]
138              Save the option state to rcfile.  The default is the  last  con‐
139              figuration file listed in the OPTION PRESETS section, below.
140
141       -< rcfile, --load-opts=rcfile, --no-load-opts
142              Load  options  from  rcfile.  The no-load-opts form will disable
143              the loading of earlier RC/INI files.  --no-load-opts is  handled
144              early, out of order.
145
146       - [{v|c|n}], --version[={v|c|n}]
147              Output  version of program and exit.  The default mode is `v', a
148              simple version.  The `c' mode will print  copyright  information
149              and `n' will print the full copyright notice.
150

OPTION PRESETS

152       Any option that is not marked as not presettable may be preset by load‐
153       ing values from configuration ("RC" or ".INI") file(s) and values  from
154       environment variables named:
155         SNTP_<option-name> or SNTP
156       The  environmental  presets  take precedence (are processed later than)
157       the configuration files.  The homerc files are "$HOME",  and  ".".   If
158       any  of  these  are  directories,  then the file .ntprc is searched for
159       within those directories.
160

USAGE

162       The simplest use of this program is as an unprivileged command to check
163       the current time and error in the local clock.  For example:
164
165              sntp ntpserver.somewhere
166
167       With suitable privilege, it can be run as a command or in a cron job to
168       reset the local clock from a reliable  server,  like  the  ntpdate  and
169       rdate commands.  For example:
170
171              sntp -a ntpserver.somewhere
172

RETURN VALUE

174       The  program returns a zero exit status for success, and a non-zero one
175       otherwise.
176

BUGS

178       Please report bugs to http://bugs.ntp.org .
179

AUTHOR

181       David L. Mills and/or others
182       Please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
183
184
185       see html/copyright.html
186
187
188       This manual page was AutoGen-erated from the sntp option definitions.
189
190
191
192( 4.2.6p5)                        2011-12-24                           SNTP(8)
Impressum