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

NAME

6       sntp - standard SNTP 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  Oct  15
24       20:17:25.123  +4.567 +/- 0.089 secs', where the '+4.567 +/- 0.089 secs'
25       indicates the local clock is 4.567 seconds behind the correct time  (so
26       4.567  seconds  must  be  added to the local clock to get it to be cor‐
27       rect), and the time of is believed to be correct to  within  +/-  0.089
28       seconds.
29

OPTIONS

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

OPTION PRESETS

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

USAGE

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

RETURN VALUE

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

BUGS

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

AUTHOR

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