xref: /netbsd-src/external/bsd/ntp/dist/ntpdc/ntpdc.html (revision 897be3a4bac39d8b2e92077bf29f4a2e67d31983)
1067f5680Schristos<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2067f5680Schristos<html>
3*897be3a4Schristos<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
48585484eSchristos<head>
5067f5680Schristos<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6067f5680Schristos<title>ntpdc: NTPD Control User&rsquo;s Manual</title>
7067f5680Schristos
8067f5680Schristos<meta name="description" content="ntpdc: NTPD Control User&rsquo;s Manual">
9067f5680Schristos<meta name="keywords" content="ntpdc: NTPD Control User&rsquo;s Manual">
10067f5680Schristos<meta name="resource-type" content="document">
11067f5680Schristos<meta name="distribution" content="global">
12067f5680Schristos<meta name="Generator" content="makeinfo">
13067f5680Schristos<link href="#Top" rel="start" title="Top">
14067f5680Schristos<link href="dir.html#Top" rel="up" title="(dir)">
15067f5680Schristos<style type="text/css">
16067f5680Schristos<!--
17067f5680Schristosa.summary-letter {text-decoration: none}
18067f5680Schristosblockquote.indentedblock {margin-right: 0em}
19067f5680Schristosdiv.display {margin-left: 3.2em}
20067f5680Schristosdiv.example {margin-left: 3.2em}
21067f5680Schristosdiv.lisp {margin-left: 3.2em}
22067f5680Schristoskbd {font-style: oblique}
238585484eSchristospre.display {font-family: inherit}
248585484eSchristospre.format {font-family: inherit}
25067f5680Schristospre.menu-comment {font-family: serif}
26067f5680Schristospre.menu-preformatted {font-family: serif}
27067f5680Schristosspan.nolinebreak {white-space: nowrap}
28067f5680Schristosspan.roman {font-family: initial; font-weight: normal}
29067f5680Schristosspan.sansserif {font-family: sans-serif; font-weight: normal}
30067f5680Schristosul.no-bullet {list-style: none}
31067f5680Schristos-->
32067f5680Schristos</style>
33067f5680Schristos
34067f5680Schristos
358585484eSchristos</head>
36067f5680Schristos
37067f5680Schristos<body lang="en">
38067f5680Schristos<h1 class="settitle" align="center">ntpdc: NTPD Control User&rsquo;s Manual</h1>
39067f5680Schristos
40067f5680Schristos
41067f5680Schristos
42067f5680Schristos
43067f5680Schristos
44*897be3a4Schristos<span id="Top"></span><div class="header">
45067f5680Schristos<p>
46067f5680SchristosNext: <a href="#ntpdc-Description" accesskey="n" rel="next">ntpdc Description</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
478585484eSchristos</div>
48*897be3a4Schristos<span id="ntpdc_003a-NTPD-Control-User-Manual"></span><h1 class="top">ntpdc: NTPD Control User Manual</h1>
498585484eSchristos
50067f5680Schristos<p>This document describes the use of the NTP Project&rsquo;s <code>ntpdc</code> program,
518585484eSchristosthat can be used to query a Network Time Protocol (NTP) server and
528585484eSchristosdisplay the time offset of the system clock relative to the server
538585484eSchristosclock.  Run as root, it can correct the system clock to this offset as
548585484eSchristoswell.  It can be run as an interactive command or from a cron job.
55067f5680Schristos</p>
56*897be3a4Schristos<p>This document applies to version 4.2.8p18 of <code>ntpdc</code>.
57067f5680Schristos</p>
588585484eSchristos<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
598585484eSchristosIETF specification.
60067f5680Schristos</p>
61*897be3a4Schristos<span id="SEC_Overview"></span>
62067f5680Schristos<h2 class="shortcontents-heading">Short Table of Contents</h2>
638585484eSchristos
648585484eSchristos<div class="shortcontents">
65067f5680Schristos<ul class="no-bullet">
66*897be3a4Schristos<li><a id="stoc-Description" href="#toc-Description">1 Description</a></li>
678585484eSchristos</ul>
688585484eSchristos</div>
698585484eSchristos
708585484eSchristos
71067f5680Schristos<table class="menu" border="0" cellspacing="0">
72*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Description" accesskey="1">ntpdc Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
73067f5680Schristos</td></tr>
74*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Invocation" accesskey="2">ntpdc Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntpdc
75067f5680Schristos</td></tr>
76*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="3">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Usage
77067f5680Schristos</td></tr>
78067f5680Schristos</table>
79067f5680Schristos
80067f5680Schristos<hr>
81*897be3a4Schristos<span id="ntpdc-Description"></span><div class="header">
82067f5680Schristos<p>
83067f5680SchristosNext: <a href="#ntpdc-Invocation" accesskey="n" rel="next">ntpdc Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
848585484eSchristos</div>
85*897be3a4Schristos<span id="Description"></span><h2 class="chapter">1 Description</h2>
868585484eSchristos
878585484eSchristos<p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
888585484eSchristosstandard output in the format:
89067f5680Schristos</p>
90067f5680Schristos<div class="example">
918585484eSchristos<pre class="example">1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
92067f5680Schristos</pre></div>
93067f5680Schristos
948585484eSchristos<p>where
958585484eSchristosYYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
968585484eSchristos(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
978585484eSchristosand
988585484eSchristosthe +4.567 +/- 0.089 secs indicates the time offset and
998585484eSchristoserror bound of the system clock relative to the server clock.
100067f5680Schristos</p>
101067f5680Schristos<table class="menu" border="0" cellspacing="0">
102*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Invocation" accesskey="1">Invoking ntpdc</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
103067f5680Schristos</td></tr>
104*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
105067f5680Schristos</td></tr>
106067f5680Schristos</table>
1078585484eSchristos
108067f5680Schristos<hr>
109*897be3a4Schristos<span id="ntpdc-Invocation"></span><div class="header">
110067f5680Schristos<p>
111067f5680SchristosNext: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a href="#ntpdc-Description" accesskey="p" rel="prev">ntpdc Description</a>, Up: <a href="#ntpdc-Description" accesskey="u" rel="up">ntpdc Description</a> &nbsp; </p>
1128585484eSchristos</div>
113*897be3a4Schristos<span id="Invoking-ntpdc"></span><h3 class="section">1.1 Invoking ntpdc</h3>
114*897be3a4Schristos<span id="index-ntpdc"></span>
115*897be3a4Schristos<span id="index-vendor_002dspecific-NTPD-control-program"></span>
1168585484eSchristos
1178585484eSchristos
1188585484eSchristos
1198585484eSchristos<p><code>ntpdc</code>
120b8ecfcfeSchristosis deprecated.
121b8ecfcfeSchristosPlease use
122b8ecfcfeSchristos<code>ntpq(1ntpqmdoc)</code> instead - it can do everything
123b8ecfcfeSchristos<code>ntpdc</code>
124b8ecfcfeSchristosused to do, and it does so using a much more sane interface.
125067f5680Schristos</p>
126b8ecfcfeSchristos<p><code>ntpdc</code>
1278585484eSchristosis a utility program used to query
1288585484eSchristos<code>ntpd(1ntpdmdoc)</code>
1298585484eSchristosabout its
1308585484eSchristoscurrent state and to request changes in that state.
1318585484eSchristosIt uses NTP mode 7 control message formats described in the source code.
1328585484eSchristosThe program may
1338585484eSchristosbe run either in interactive mode or controlled using command line
1348585484eSchristosarguments.
1358585484eSchristosExtensive state and statistics information is available
1368585484eSchristosthrough the
1378585484eSchristos<code>ntpdc</code>
1388585484eSchristosinterface.
1398585484eSchristosIn addition, nearly all the
1408585484eSchristosconfiguration options which can be specified at startup using
141067f5680Schristosntpd&rsquo;s configuration file may also be specified at run time using
1428585484eSchristos<code>ntpdc</code>
143067f5680Schristos</p>
1448585484eSchristos<p>This section was generated by <strong>AutoGen</strong>,
1458585484eSchristosusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
1468585484eSchristosThis software is released under the NTP license, &lt;http://ntp.org/license&gt;.
147067f5680Schristos</p>
148067f5680Schristos<table class="menu" border="0" cellspacing="0">
149*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-usage" accesskey="1">ntpdc usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntpdc help/usage (<samp>--help</samp>)
150067f5680Schristos</td></tr>
151*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-ipv4" accesskey="2">ntpdc ipv4</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv4 option (-4)
152067f5680Schristos</td></tr>
153*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-ipv6" accesskey="3">ntpdc ipv6</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv6 option (-6)
154067f5680Schristos</td></tr>
155*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-command" accesskey="4">ntpdc command</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">command option (-c)
156067f5680Schristos</td></tr>
157*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-interactive" accesskey="5">ntpdc interactive</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">interactive option (-i)
158067f5680Schristos</td></tr>
159*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-listpeers" accesskey="6">ntpdc listpeers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">listpeers option (-l)
160067f5680Schristos</td></tr>
161*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-numeric" accesskey="7">ntpdc numeric</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">numeric option (-n)
162067f5680Schristos</td></tr>
163*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-peers" accesskey="8">ntpdc peers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">peers option (-p)
164067f5680Schristos</td></tr>
165*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-showpeers" accesskey="9">ntpdc showpeers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">showpeers option (-s)
166067f5680Schristos</td></tr>
167*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-unconnected">ntpdc unconnected</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">unconnected option (-u)
168067f5680Schristos</td></tr>
169*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-config">ntpdc config</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">presetting/configuring ntpdc
170067f5680Schristos</td></tr>
171*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-exit-status">ntpdc exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
172067f5680Schristos</td></tr>
173*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Usage">ntpdc Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Usage
174067f5680Schristos</td></tr>
175*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-See-Also">ntpdc See Also</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">See Also
176067f5680Schristos</td></tr>
177*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Authors">ntpdc Authors</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Authors
178*897be3a4Schristos</td></tr>
179*897be3a4Schristos<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Bugs">ntpdc Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Bugs
180067f5680Schristos</td></tr>
181067f5680Schristos</table>
1828585484eSchristos
183067f5680Schristos<hr>
184*897be3a4Schristos<span id="ntpdc-usage"></span><div class="header">
185067f5680Schristos<p>
186067f5680SchristosNext: <a href="#ntpdc-ipv4" accesskey="n" rel="next">ntpdc ipv4</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
1878585484eSchristos</div>
188*897be3a4Schristos<span id="ntpdc-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1.1 ntpdc help/usage (<samp>--help</samp>)</h4>
189*897be3a4Schristos<span id="index-ntpdc-help"></span>
1908585484eSchristos
191067f5680Schristos<p>This is the automatically generated usage text for ntpdc.
192067f5680Schristos</p>
1938585484eSchristos<p>The text printed is the same whether selected with the <code>help</code> option
194067f5680Schristos(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1958585484eSchristosthe usage text by passing it through a pager program.
1968585484eSchristos<code>more-help</code> is disabled on platforms without a working
1978585484eSchristos<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
198067f5680Schristosused to select the program, defaulting to <samp>more</samp>.  Both will exit
1998585484eSchristoswith a status code of 0.
200067f5680Schristos</p>
201067f5680Schristos<div class="example">
202*897be3a4Schristos<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18
2038585484eSchristosUsage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
2048585484eSchristos  Flg Arg Option-Name    Description
2058585484eSchristos   -4 no  ipv4           Force IPv4 DNS name resolution
2068585484eSchristos                                - prohibits the option 'ipv6'
2078585484eSchristos   -6 no  ipv6           Force IPv6 DNS name resolution
2088585484eSchristos                                - prohibits the option 'ipv4'
2098585484eSchristos   -c Str command        run a command and exit
2108585484eSchristos                                - may appear multiple times
2118585484eSchristos   -d no  debug-level    Increase debug verbosity level
2128585484eSchristos                                - may appear multiple times
2138585484eSchristos   -D Num set-debug-level Set the debug verbosity level
2148585484eSchristos                                - may appear multiple times
2158585484eSchristos   -i no  interactive    Force ntpq to operate in interactive mode
2168585484eSchristos                                - prohibits these options:
2178585484eSchristos                                command
2188585484eSchristos                                listpeers
2198585484eSchristos                                peers
2208585484eSchristos                                showpeers
2218585484eSchristos   -l no  listpeers      Print a list of the peers
2228585484eSchristos                                - prohibits the option 'command'
2238585484eSchristos   -n no  numeric        numeric host addresses
2248585484eSchristos   -p no  peers          Print a list of the peers
2258585484eSchristos                                - prohibits the option 'command'
2268585484eSchristos   -s no  showpeers      Show a list of the peers
2278585484eSchristos                                - prohibits the option 'command'
228*897be3a4Schristos   -u no  unconnected    Use unconnected UDP to communicate with ntpd (default on Windows)
2298585484eSchristos      opt version        output version information and exit
2308585484eSchristos   -? no  help           display extended usage information and exit
2318585484eSchristos   -! no  more-help      extended usage information passed thru pager
2328585484eSchristos   -&gt; opt save-opts      save the option state to a config file
2338585484eSchristos   -&lt; Str load-opts      load options from a config file
2348585484eSchristos                                - disabled as '--no-load-opts'
2358585484eSchristos                                - may appear multiple times
2368585484eSchristos
2378585484eSchristosOptions are specified by doubled hyphens and their name or by a single
2388585484eSchristoshyphen and the flag character.
2398585484eSchristos
2408585484eSchristos
2418585484eSchristosThe following option preset mechanisms are supported:
2428585484eSchristos - reading file $HOME/.ntprc
2438585484eSchristos - reading file ./.ntprc
2448585484eSchristos - examining environment variables named NTPDC_*
2458585484eSchristos
246*897be3a4SchristosPlease send bug reports to:  &lt;https://bugs.ntp.org, bugs@ntp.org&gt;
247067f5680Schristos</pre></div>
248067f5680Schristos
249067f5680Schristos<hr>
250*897be3a4Schristos<span id="ntpdc-ipv4"></span><div class="header">
251067f5680Schristos<p>
252067f5680SchristosNext: <a href="#ntpdc-ipv6" accesskey="n" rel="next">ntpdc ipv6</a>, Previous: <a href="#ntpdc-usage" accesskey="p" rel="prev">ntpdc usage</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
2538585484eSchristos</div>
254*897be3a4Schristos<span id="ipv4-option-_0028_002d4_0029"></span><h4 class="subsection">1.1.2 ipv4 option (-4)</h4>
255*897be3a4Schristos<span id="index-ntpdc_002dipv4"></span>
2568585484eSchristos
257067f5680Schristos<p>This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
258067f5680Schristos</p>
259067f5680Schristos<p>This option has some usage constraints.  It:
260067f5680Schristos</p><ul>
2618585484eSchristos<li> must not appear in combination with any of the following options:
2628585484eSchristosipv6.
263067f5680Schristos</li></ul>
2648585484eSchristos
2658585484eSchristos<p>Force DNS resolution of following host names on the command line
2668585484eSchristosto the IPv4 namespace.
267067f5680Schristos</p><hr>
268*897be3a4Schristos<span id="ntpdc-ipv6"></span><div class="header">
269067f5680Schristos<p>
270067f5680SchristosNext: <a href="#ntpdc-command" accesskey="n" rel="next">ntpdc command</a>, Previous: <a href="#ntpdc-ipv4" accesskey="p" rel="prev">ntpdc ipv4</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
2718585484eSchristos</div>
272*897be3a4Schristos<span id="ipv6-option-_0028_002d6_0029"></span><h4 class="subsection">1.1.3 ipv6 option (-6)</h4>
273*897be3a4Schristos<span id="index-ntpdc_002dipv6"></span>
2748585484eSchristos
275067f5680Schristos<p>This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
276067f5680Schristos</p>
277067f5680Schristos<p>This option has some usage constraints.  It:
278067f5680Schristos</p><ul>
2798585484eSchristos<li> must not appear in combination with any of the following options:
2808585484eSchristosipv4.
281067f5680Schristos</li></ul>
2828585484eSchristos
2838585484eSchristos<p>Force DNS resolution of following host names on the command line
2848585484eSchristosto the IPv6 namespace.
285067f5680Schristos</p><hr>
286*897be3a4Schristos<span id="ntpdc-command"></span><div class="header">
287067f5680Schristos<p>
288067f5680SchristosNext: <a href="#ntpdc-interactive" accesskey="n" rel="next">ntpdc interactive</a>, Previous: <a href="#ntpdc-ipv6" accesskey="p" rel="prev">ntpdc ipv6</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
2898585484eSchristos</div>
290*897be3a4Schristos<span id="command-option-_0028_002dc_0029"></span><h4 class="subsection">1.1.4 command option (-c)</h4>
291*897be3a4Schristos<span id="index-ntpdc_002dcommand"></span>
2928585484eSchristos
293067f5680Schristos<p>This is the &ldquo;run a command and exit&rdquo; option.
294067f5680SchristosThis option takes a string argument <samp>cmd</samp>.
295067f5680Schristos</p>
296067f5680Schristos<p>This option has some usage constraints.  It:
297067f5680Schristos</p><ul>
2988585484eSchristos<li> may appear an unlimited number of times.
299067f5680Schristos</li></ul>
3008585484eSchristos
3018585484eSchristos<p>The following argument is interpreted as an interactive format command
3028585484eSchristosand is added to the list of commands to be executed on the specified
3038585484eSchristoshost(s).
304067f5680Schristos</p><hr>
305*897be3a4Schristos<span id="ntpdc-interactive"></span><div class="header">
306067f5680Schristos<p>
307067f5680SchristosNext: <a href="#ntpdc-listpeers" accesskey="n" rel="next">ntpdc listpeers</a>, Previous: <a href="#ntpdc-command" accesskey="p" rel="prev">ntpdc command</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
3088585484eSchristos</div>
309*897be3a4Schristos<span id="interactive-option-_0028_002di_0029"></span><h4 class="subsection">1.1.5 interactive option (-i)</h4>
310*897be3a4Schristos<span id="index-ntpdc_002dinteractive"></span>
3118585484eSchristos
312067f5680Schristos<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
313067f5680Schristos</p>
314067f5680Schristos<p>This option has some usage constraints.  It:
315067f5680Schristos</p><ul>
3168585484eSchristos<li> must not appear in combination with any of the following options:
3178585484eSchristoscommand, listpeers, peers, showpeers.
318067f5680Schristos</li></ul>
3198585484eSchristos
3208585484eSchristos<p>Force ntpq to operate in interactive mode.  Prompts will be written
3218585484eSchristosto the standard output and commands read from the standard input.
322067f5680Schristos</p><hr>
323*897be3a4Schristos<span id="ntpdc-listpeers"></span><div class="header">
324067f5680Schristos<p>
325067f5680SchristosNext: <a href="#ntpdc-numeric" accesskey="n" rel="next">ntpdc numeric</a>, Previous: <a href="#ntpdc-interactive" accesskey="p" rel="prev">ntpdc interactive</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
3268585484eSchristos</div>
327*897be3a4Schristos<span id="listpeers-option-_0028_002dl_0029"></span><h4 class="subsection">1.1.6 listpeers option (-l)</h4>
328*897be3a4Schristos<span id="index-ntpdc_002dlistpeers"></span>
3298585484eSchristos
330067f5680Schristos<p>This is the &ldquo;print a list of the peers&rdquo; option.
331067f5680Schristos</p>
332067f5680Schristos<p>This option has some usage constraints.  It:
333067f5680Schristos</p><ul>
3348585484eSchristos<li> must not appear in combination with any of the following options:
3358585484eSchristoscommand.
336067f5680Schristos</li></ul>
3378585484eSchristos
3388585484eSchristos<p>Print a list of the peers known to the server as well as a summary of
339067f5680Schristostheir state. This is equivalent to the &rsquo;listpeers&rsquo; interactive command.
340067f5680Schristos</p><hr>
341*897be3a4Schristos<span id="ntpdc-numeric"></span><div class="header">
342067f5680Schristos<p>
343067f5680SchristosNext: <a href="#ntpdc-peers" accesskey="n" rel="next">ntpdc peers</a>, Previous: <a href="#ntpdc-listpeers" accesskey="p" rel="prev">ntpdc listpeers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
3448585484eSchristos</div>
345*897be3a4Schristos<span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.7 numeric option (-n)</h4>
346*897be3a4Schristos<span id="index-ntpdc_002dnumeric"></span>
3478585484eSchristos
348067f5680Schristos<p>This is the &ldquo;numeric host addresses&rdquo; option.
3498585484eSchristosOutput all host addresses in dotted-quad numeric format rather than
3508585484eSchristosconverting to the canonical host names.
351067f5680Schristos</p><hr>
352*897be3a4Schristos<span id="ntpdc-peers"></span><div class="header">
353067f5680Schristos<p>
354067f5680SchristosNext: <a href="#ntpdc-showpeers" accesskey="n" rel="next">ntpdc showpeers</a>, Previous: <a href="#ntpdc-numeric" accesskey="p" rel="prev">ntpdc numeric</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
3558585484eSchristos</div>
356*897be3a4Schristos<span id="peers-option-_0028_002dp_0029"></span><h4 class="subsection">1.1.8 peers option (-p)</h4>
357*897be3a4Schristos<span id="index-ntpdc_002dpeers"></span>
3588585484eSchristos
359067f5680Schristos<p>This is the &ldquo;print a list of the peers&rdquo; option.
360067f5680Schristos</p>
361067f5680Schristos<p>This option has some usage constraints.  It:
362067f5680Schristos</p><ul>
3638585484eSchristos<li> must not appear in combination with any of the following options:
3648585484eSchristoscommand.
365067f5680Schristos</li></ul>
3668585484eSchristos
3678585484eSchristos<p>Print a list of the peers known to the server as well as a summary
368067f5680Schristosof their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
369067f5680Schristos</p><hr>
370*897be3a4Schristos<span id="ntpdc-showpeers"></span><div class="header">
371067f5680Schristos<p>
372*897be3a4SchristosNext: <a href="#ntpdc-unconnected" accesskey="n" rel="next">ntpdc unconnected</a>, Previous: <a href="#ntpdc-peers" accesskey="p" rel="prev">ntpdc peers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
3738585484eSchristos</div>
374*897be3a4Schristos<span id="showpeers-option-_0028_002ds_0029"></span><h4 class="subsection">1.1.9 showpeers option (-s)</h4>
375*897be3a4Schristos<span id="index-ntpdc_002dshowpeers"></span>
3768585484eSchristos
377067f5680Schristos<p>This is the &ldquo;show a list of the peers&rdquo; option.
378067f5680Schristos</p>
379067f5680Schristos<p>This option has some usage constraints.  It:
380067f5680Schristos</p><ul>
3818585484eSchristos<li> must not appear in combination with any of the following options:
3828585484eSchristoscommand.
383067f5680Schristos</li></ul>
3848585484eSchristos
3858585484eSchristos<p>Print a list of the peers known to the server as well as a summary
386067f5680Schristosof their state. This is equivalent to the &rsquo;dmpeers&rsquo; interactive command.
387*897be3a4Schristos</p><hr>
388*897be3a4Schristos<span id="ntpdc-unconnected"></span><div class="header">
389*897be3a4Schristos<p>
390*897be3a4SchristosNext: <a href="#ntpdc-config" accesskey="n" rel="next">ntpdc config</a>, Previous: <a href="#ntpdc-showpeers" accesskey="p" rel="prev">ntpdc showpeers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
391*897be3a4Schristos</div>
392*897be3a4Schristos<span id="unconnected-option-_0028_002du_0029"></span><h4 class="subsection">1.1.10 unconnected option (-u)</h4>
393*897be3a4Schristos<span id="index-ntpdc_002dunconnected"></span>
394*897be3a4Schristos
395*897be3a4Schristos<p>This is the &ldquo;use unconnected udp to communicate with ntpd (default on windows)&rdquo; option.
396*897be3a4SchristosOpen an unconnected UDP association to ntpd (the default
397*897be3a4Schristoson Windows).
398067f5680Schristos</p>
3998585484eSchristos
400067f5680Schristos<hr>
401*897be3a4Schristos<span id="ntpdc-config"></span><div class="header">
402067f5680Schristos<p>
403*897be3a4SchristosNext: <a href="#ntpdc-exit-status" accesskey="n" rel="next">ntpdc exit status</a>, Previous: <a href="#ntpdc-unconnected" accesskey="p" rel="prev">ntpdc unconnected</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
4048585484eSchristos</div>
405*897be3a4Schristos<span id="presetting_002fconfiguring-ntpdc"></span><h4 class="subsection">1.1.11 presetting/configuring ntpdc</h4>
4068585484eSchristos
4078585484eSchristos<p>Any option that is not marked as <i>not presettable</i> may be preset by
408067f5680Schristosloading values from configuration (&quot;rc&quot; or &quot;ini&quot;) files, and values from environment variables named <code>NTPDC</code> and <code>NTPDC_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
4098585484eSchristosthe options listed above in upper case and segmented with underscores.
4108585484eSchristosThe <code>NTPDC</code> variable will be tokenized and parsed like
4118585484eSchristosthe command line.  The remaining variables are tested for existence and their
4128585484eSchristosvalues are treated like option arguments.
413067f5680Schristos</p>
4148585484eSchristos
415067f5680Schristos<p><code>libopts</code> will search in 2 places for configuration files:
416067f5680Schristos</p><ul>
4178585484eSchristos<li> $HOME
418067f5680Schristos</li><li> $PWD
419067f5680Schristos</li></ul>
420067f5680Schristos<p>The environment variables <code>HOME</code>, and <code>PWD</code>
421067f5680Schristosare expanded and replaced when <samp>ntpdc</samp> runs.
4228585484eSchristosFor any of these that are plain files, they are simply processed.
423067f5680SchristosFor any that are directories, then a file named <samp>.ntprc</samp> is searched for
4248585484eSchristoswithin that directory and processed.
425067f5680Schristos</p>
4268585484eSchristos<p>Configuration files may be in a wide variety of formats.
4278585484eSchristosThe basic format is an option name followed by a value (argument) on the
4288585484eSchristossame line.  Values may be separated from the option name with a colon,
4298585484eSchristosequal sign or simply white space.  Values may be continued across multiple
4308585484eSchristoslines by escaping the newline with a backslash.
431067f5680Schristos</p>
4328585484eSchristos<p>Multiple programs may also share the same initialization file.
4338585484eSchristosCommon options are collected at the top, followed by program specific
4348585484eSchristossegments.  The segments are separated by lines like:
435067f5680Schristos</p><div class="example">
4368585484eSchristos<pre class="example">[NTPDC]
437067f5680Schristos</pre></div>
438067f5680Schristos<p>or by
439067f5680Schristos</p><div class="example">
4408585484eSchristos<pre class="example">&lt;?program ntpdc&gt;
441067f5680Schristos</pre></div>
442067f5680Schristos<p>Do not mix these styles within one configuration file.
443067f5680Schristos</p>
4448585484eSchristos<p>Compound values and carefully constructed string values may also be
4458585484eSchristosspecified using XML syntax:
446067f5680Schristos</p><div class="example">
4478585484eSchristos<pre class="example">&lt;option-name&gt;
4488585484eSchristos   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
4498585484eSchristos&lt;/option-name&gt;
450067f5680Schristos</pre></div>
451067f5680Schristos<p>yielding an <code>option-name.sub-opt</code> string value of
452067f5680Schristos</p><div class="example">
453067f5680Schristos<pre class="example">&quot;...&lt;...&gt;...&quot;
454067f5680Schristos</pre></div>
4558585484eSchristos<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
4568585484eSchristoshierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
4578585484eSchristosthe associated name/value pair list (see: optionFindValue).
458067f5680Schristos</p>
4598585484eSchristos<p>The command line options relating to configuration and/or usage help are:
460067f5680Schristos</p>
461*897be3a4Schristos<span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
4628585484eSchristos
4638585484eSchristos<p>Print the program version to standard out, optionally with licensing
4648585484eSchristosinformation, then exit 0.  The optional argument specifies how much licensing
465*897be3a4Schristosdetail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
4668585484eSchristosOnly the first letter of the argument is examined:
467067f5680Schristos</p>
468067f5680Schristos<dl compact="compact">
469067f5680Schristos<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
470067f5680Schristos<dd><p>Only print the version.  This is the default.
471067f5680Schristos</p></dd>
472067f5680Schristos<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
473067f5680Schristos<dd><p>Name the copyright usage licensing terms.
474067f5680Schristos</p></dd>
475067f5680Schristos<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
476067f5680Schristos<dd><p>Print the full copyright usage licensing terms.
477067f5680Schristos</p></dd>
4788585484eSchristos</dl>
4798585484eSchristos
480067f5680Schristos<hr>
481*897be3a4Schristos<span id="ntpdc-exit-status"></span><div class="header">
482067f5680Schristos<p>
483067f5680SchristosNext: <a href="#ntpdc-Usage" accesskey="n" rel="next">ntpdc Usage</a>, Previous: <a href="#ntpdc-config" accesskey="p" rel="prev">ntpdc config</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
4848585484eSchristos</div>
485*897be3a4Schristos<span id="ntpdc-exit-status-1"></span><h4 class="subsection">1.1.12 ntpdc exit status</h4>
4868585484eSchristos
4878585484eSchristos<p>One of the following exit values will be returned:
488067f5680Schristos</p><dl compact="compact">
489067f5680Schristos<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
490067f5680Schristos<dd><p>Successful program execution.
491067f5680Schristos</p></dd>
492067f5680Schristos<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
493067f5680Schristos<dd><p>The operation failed or the command syntax was not valid.
494067f5680Schristos</p></dd>
495067f5680Schristos<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
496067f5680Schristos<dd><p>A specified configuration file could not be loaded.
497067f5680Schristos</p></dd>
498067f5680Schristos<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
499067f5680Schristos<dd><p>libopts had an internal operational error.  Please report
5008585484eSchristosit to autogen-users@lists.sourceforge.net.  Thank you.
501067f5680Schristos</p></dd>
5028585484eSchristos</dl>
503067f5680Schristos<hr>
504*897be3a4Schristos<span id="ntpdc-Usage"></span><div class="header">
505067f5680Schristos<p>
506067f5680SchristosNext: <a href="#ntpdc-See-Also" accesskey="n" rel="next">ntpdc See Also</a>, Previous: <a href="#ntpdc-exit-status" accesskey="p" rel="prev">ntpdc exit status</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
5078585484eSchristos</div>
508*897be3a4Schristos<span id="ntpdc-Usage-1"></span><h4 class="subsection">1.1.13 ntpdc Usage</h4>
509067f5680Schristos<hr>
510*897be3a4Schristos<span id="ntpdc-See-Also"></span><div class="header">
511067f5680Schristos<p>
512067f5680SchristosNext: <a href="#ntpdc-Authors" accesskey="n" rel="next">ntpdc Authors</a>, Previous: <a href="#ntpdc-Usage" accesskey="p" rel="prev">ntpdc Usage</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
5138585484eSchristos</div>
514*897be3a4Schristos<span id="ntpdc-See-Also-1"></span><h4 class="subsection">1.1.14 ntpdc See Also</h4>
515067f5680Schristos<hr>
516*897be3a4Schristos<span id="ntpdc-Authors"></span><div class="header">
517067f5680Schristos<p>
518067f5680SchristosNext: <a href="#ntpdc-Bugs" accesskey="n" rel="next">ntpdc Bugs</a>, Previous: <a href="#ntpdc-See-Also" accesskey="p" rel="prev">ntpdc See Also</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
5198585484eSchristos</div>
520*897be3a4Schristos<span id="ntpdc-Authors-1"></span><h4 class="subsection">1.1.15 ntpdc Authors</h4>
521067f5680Schristos<hr>
522*897be3a4Schristos<span id="ntpdc-Bugs"></span><div class="header">
523067f5680Schristos<p>
524067f5680SchristosPrevious: <a href="#ntpdc-Authors" accesskey="p" rel="prev">ntpdc Authors</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
5258585484eSchristos</div>
526*897be3a4Schristos<span id="ntpdc-Bugs-1"></span><h4 class="subsection">1.1.16 ntpdc Bugs</h4>
5278585484eSchristos
528067f5680Schristos<hr>
529*897be3a4Schristos<span id="Usage"></span><div class="header">
530067f5680Schristos<p>
531067f5680SchristosPrevious: <a href="#ntpdc-Invocation" accesskey="p" rel="prev">ntpdc Invocation</a>, Up: <a href="#ntpdc-Description" accesskey="u" rel="up">ntpdc Description</a> &nbsp; </p>
5328585484eSchristos</div>
533*897be3a4Schristos<span id="Usage-1"></span><h3 class="section">1.2 Usage</h3>
5348585484eSchristos
5358585484eSchristos<p>The simplest use of this program is as an unprivileged command to
5368585484eSchristoscheck the current time, offset, and error in the local clock.
5378585484eSchristosFor example:
538067f5680Schristos</p>
539067f5680Schristos<div class="example">
5408585484eSchristos<pre class="example">ntpdc ntpserver.somewhere
541067f5680Schristos</pre></div>
542067f5680Schristos
5438585484eSchristos<p>With suitable privilege, it can be run as a command or in a
5448585484eSchristos<code>cron</code> job to reset the local clock from a reliable server, like
5458585484eSchristosthe <code>ntpdate</code> and <code>rdate</code> commands.
5468585484eSchristosFor example:
547067f5680Schristos</p>
548067f5680Schristos<div class="example">
5498585484eSchristos<pre class="example">ntpdc -a ntpserver.somewhere
550067f5680Schristos</pre></div>
551067f5680Schristos<hr>
5528585484eSchristos
553067f5680Schristos
554067f5680Schristos
555067f5680Schristos</body>
556067f5680Schristos</html>
557