1258945Sroberto\input texinfo    @c -*-texinfo-*-
2258945Sroberto@c %**start of header
3258945Sroberto@setfilename sntp.info
4258945Sroberto@settitle Sntp User's Manual
5280849Scy@include include/version.texi
6258945Sroberto@paragraphindent 2
7258945Sroberto@c %**end of header
8258945Sroberto
9258945Sroberto@ifinfo
10258945SrobertoThis file documents the use of the NTP Project's SNTP, a program for
11258945Srobertoquerying and setting the time.
12258945Sroberto@end ifinfo
13258945Sroberto
14258945Sroberto@direntry
15258945Sroberto* sntp: (sntp).                               Simple Network Time Protocol
16258945Sroberto@end direntry
17258945Sroberto
18258945Sroberto@titlepage
19258945Sroberto@title Simple Network Time Protocol User's Manual
20258945Sroberto@subtitle sntp, version @value{VERSION}, @value{UPDATED}
21258945Sroberto@c @author Max @email{foo@ntp.org}
22258945Sroberto@end titlepage
23258945Sroberto
24258945Sroberto@c @page
25258945Sroberto@c @vskip 0pt plus 1filll
26258945Sroberto
27258945Sroberto@node Top, sntp Description, (dir), (dir)
28258945Sroberto@top Simple Network Time Protocol User Manual
29258945Sroberto
30258945SrobertoThis document describes the use of the NTP Project's @code{sntp} program,
31258945Srobertothat can be used to query a Network Time Protocol (NTP) server and
32258945Srobertodisplay the time offset of the system clock relative to the server
33258945Srobertoclock.  Run as root, it can correct the system clock to this offset as
34258945Srobertowell.  It can be run as an interactive command or from a cron job.
35258945Sroberto
36258945SrobertoThis document applies to version @value{VERSION} of @code{sntp}.
37258945Sroberto
38258945SrobertoThe program implements the SNTP protocol as defined by RFC 5905, the NTPv4
39258945SrobertoIETF specification.
40258945Sroberto
41258945Sroberto@shortcontents
42258945Sroberto
43258945Sroberto@menu
44258945Sroberto* sntp Description::            Description
45258945Sroberto* sntp Invocation::		Invoking sntp
46258945Sroberto* Usage::                       Usage
47258945Sroberto@end menu
48258945Sroberto
49258945Sroberto@node sntp Description
50258945Sroberto@comment  node-name,  next,  previous,  up
51258945Sroberto@section Description
52258945Sroberto
53258945SrobertoBy default, @code{sntp} writes the local data and time (i.e., not UTC) to the
54258945Srobertostandard output in the format:
55258945Sroberto
56258945Sroberto@example
57280849Scy1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
58258945Sroberto@end example
59258945Sroberto
60280849Scywhere
61280849ScyYYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
62280849Scy(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
63280849Scyand
64280849Scythe +4.567 +/- 0.089 secs indicates the time offset and
65258945Srobertoerror bound of the system clock relative to the server clock.
66258945Sroberto
67280849Scy@include invoke-sntp.texi
68258945Sroberto
69258945Sroberto@node Usage
70258945Sroberto@comment  node-name,  next,  previous,  up
71258945Sroberto@section Usage
72258945Sroberto
73258945SrobertoThe simplest use of this program is as an unprivileged command to
74258945Srobertocheck the current time, offset, and error in the local clock.
75258945SrobertoFor example:
76258945Sroberto
77258945Sroberto@example
78258945Srobertosntp ntpserver.somewhere
79258945Sroberto@end example
80258945Sroberto
81258945SrobertoWith suitable privilege, it can be run as a command or in a
82258945Sroberto@code{crom} job to reset the local clock from a reliable server, like
83258945Srobertothe @code{ntpdate} and @code{rdate} commands.
84258945SrobertoFor example:
85258945Sroberto
86258945Sroberto@example
87258945Srobertosntp -a ntpserver.somewhere
88258945Sroberto@end example
89