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