xref: /freebsd/contrib/ntp/sntp/sntp.texi (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubert\input texinfo    @c -*-texinfo-*-
2*2b15cb3dSCy Schubert@c %**start of header
3*2b15cb3dSCy Schubert@setfilename sntp.info
4*2b15cb3dSCy Schubert@settitle Sntp User's Manual
5*2b15cb3dSCy Schubert@include include/version.texi
6*2b15cb3dSCy Schubert@paragraphindent 2
7*2b15cb3dSCy Schubert@c %**end of header
8*2b15cb3dSCy Schubert
9*2b15cb3dSCy Schubert@ifinfo
10*2b15cb3dSCy SchubertThis file documents the use of the NTP Project's SNTP, a program for
11*2b15cb3dSCy Schubertquerying and setting the time.
12*2b15cb3dSCy Schubert@end ifinfo
13*2b15cb3dSCy Schubert
14*2b15cb3dSCy Schubert@direntry
15*2b15cb3dSCy Schubert* sntp: (sntp).                               Simple Network Time Protocol
16*2b15cb3dSCy Schubert@end direntry
17*2b15cb3dSCy Schubert
18*2b15cb3dSCy Schubert@titlepage
19*2b15cb3dSCy Schubert@title Simple Network Time Protocol User's Manual
20*2b15cb3dSCy Schubert@subtitle sntp, version @value{VERSION}, @value{UPDATED}
21*2b15cb3dSCy Schubert@c @author Max @email{foo@ntp.org}
22*2b15cb3dSCy Schubert@end titlepage
23*2b15cb3dSCy Schubert
24*2b15cb3dSCy Schubert@c @page
25*2b15cb3dSCy Schubert@c @vskip 0pt plus 1filll
26*2b15cb3dSCy Schubert
27*2b15cb3dSCy Schubert@node Top, sntp Description, (dir), (dir)
28*2b15cb3dSCy Schubert@top Simple Network Time Protocol User Manual
29*2b15cb3dSCy Schubert
30*2b15cb3dSCy SchubertThis document describes the use of the NTP Project's @code{sntp} program,
31*2b15cb3dSCy Schubertthat can be used to query a Network Time Protocol (NTP) server and
32*2b15cb3dSCy Schubertdisplay the time offset of the system clock relative to the server
33*2b15cb3dSCy Schubertclock.  Run as root, it can correct the system clock to this offset as
34*2b15cb3dSCy Schubertwell.  It can be run as an interactive command or from a cron job.
35*2b15cb3dSCy Schubert
36*2b15cb3dSCy SchubertThis document applies to version @value{VERSION} of @code{sntp}.
37*2b15cb3dSCy Schubert
38*2b15cb3dSCy SchubertThe program implements the SNTP protocol as defined by RFC 5905, the NTPv4
39*2b15cb3dSCy SchubertIETF specification.
40*2b15cb3dSCy Schubert
41*2b15cb3dSCy Schubert@shortcontents
42*2b15cb3dSCy Schubert
43*2b15cb3dSCy Schubert@menu
44*2b15cb3dSCy Schubert* sntp Description::            Description
45*2b15cb3dSCy Schubert* sntp Invocation::		Invoking sntp
46*2b15cb3dSCy Schubert* Usage::                       Usage
47*2b15cb3dSCy Schubert@end menu
48*2b15cb3dSCy Schubert
49*2b15cb3dSCy Schubert@node sntp Description
50*2b15cb3dSCy Schubert@comment  node-name,  next,  previous,  up
51*2b15cb3dSCy Schubert@section Description
52*2b15cb3dSCy Schubert
53*2b15cb3dSCy SchubertBy default, @code{sntp} writes the local data and time (i.e., not UTC) to the
54*2b15cb3dSCy Schubertstandard output in the format:
55*2b15cb3dSCy Schubert
56*2b15cb3dSCy Schubert@example
57*2b15cb3dSCy Schubert1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
58*2b15cb3dSCy Schubert@end example
59*2b15cb3dSCy Schubert
60*2b15cb3dSCy Schubertwhere
61*2b15cb3dSCy SchubertYYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
62*2b15cb3dSCy Schubert(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
63*2b15cb3dSCy Schubertand
64*2b15cb3dSCy Schubertthe +4.567 +/- 0.089 secs indicates the time offset and
65*2b15cb3dSCy Schuberterror bound of the system clock relative to the server clock.
66*2b15cb3dSCy Schubert
67*2b15cb3dSCy Schubert@include invoke-sntp.texi
68*2b15cb3dSCy Schubert
69*2b15cb3dSCy Schubert@node Usage
70*2b15cb3dSCy Schubert@comment  node-name,  next,  previous,  up
71*2b15cb3dSCy Schubert@section Usage
72*2b15cb3dSCy Schubert
73*2b15cb3dSCy SchubertThe simplest use of this program is as an unprivileged command to
74*2b15cb3dSCy Schubertcheck the current time, offset, and error in the local clock.
75*2b15cb3dSCy SchubertFor example:
76*2b15cb3dSCy Schubert
77*2b15cb3dSCy Schubert@example
78*2b15cb3dSCy Schubertsntp ntpserver.somewhere
79*2b15cb3dSCy Schubert@end example
80*2b15cb3dSCy Schubert
81*2b15cb3dSCy SchubertWith suitable privilege, it can be run as a command or in a
82*2b15cb3dSCy Schubert@code{crom} job to reset the local clock from a reliable server, like
83*2b15cb3dSCy Schubertthe @code{ntpdate} and @code{rdate} commands.
84*2b15cb3dSCy SchubertFor example:
85*2b15cb3dSCy Schubert
86*2b15cb3dSCy Schubert@example
87*2b15cb3dSCy Schubertsntp -a ntpserver.somewhere
88*2b15cb3dSCy Schubert@end example
89