xref: /freebsd/contrib/ntp/ntpdc/ntpdc.texi (revision 2b15cb3d)
1*2b15cb3dSCy Schubert\input texinfo    @c -*-texinfo-*-
2*2b15cb3dSCy Schubert@c %**start of header
3*2b15cb3dSCy Schubert@setfilename ntpdc.info
4*2b15cb3dSCy Schubert@settitle ntpdc: NTPD Control User's Manual
5*2b15cb3dSCy Schubert@include ../sntp/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 ntpdc, a program for
11*2b15cb3dSCy Schubertcontrolling ntpd.
12*2b15cb3dSCy Schubert@end ifinfo
13*2b15cb3dSCy Schubert
14*2b15cb3dSCy Schubert@direntry
15*2b15cb3dSCy Schubert* ntpdc: (ntpdc).                               ntpd Control program
16*2b15cb3dSCy Schubert@end direntry
17*2b15cb3dSCy Schubert
18*2b15cb3dSCy Schubert@titlepage
19*2b15cb3dSCy Schubert@title ntpdc: NTPD Control User's Manual
20*2b15cb3dSCy Schubert@subtitle ntpdc, 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, ntpdc Description, (dir), (dir)
28*2b15cb3dSCy Schubert@top ntpdc: NTPD Control User Manual
29*2b15cb3dSCy Schubert
30*2b15cb3dSCy SchubertThis document describes the use of the NTP Project's @code{ntpdc} 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{ntpdc}.
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* ntpdc Description::            Description
45*2b15cb3dSCy Schubert* ntpdc Invocation::		Invoking ntpdc
46*2b15cb3dSCy Schubert* Usage::                       Usage
47*2b15cb3dSCy Schubert@end menu
48*2b15cb3dSCy Schubert
49*2b15cb3dSCy Schubert@node ntpdc Description
50*2b15cb3dSCy Schubert@comment  node-name,  next,  previous,  up
51*2b15cb3dSCy Schubert@section Description
52*2b15cb3dSCy Schubert
53*2b15cb3dSCy SchubertBy default, @code{ntpdc} 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-ntpdc.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 Schubertntpdc 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{cron} 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 Schubertntpdc -a ntpserver.somewhere
88*2b15cb3dSCy Schubert@end example
89