ntpdc.html revision 344884
1145519Sdarrenr<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2145510Sdarrenr<html>
353024Sguido<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
453024Sguido<head>
553024Sguido<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
653024Sguido<title>ntpdc: NTPD Control User&rsquo;s Manual</title>
753024Sguido
853024Sguido<meta name="description" content="ntpdc: NTPD Control User&rsquo;s Manual">
953024Sguido<meta name="keywords" content="ntpdc: NTPD Control User&rsquo;s Manual">
1053024Sguido<meta name="resource-type" content="document">
1153024Sguido<meta name="distribution" content="global">
1253024Sguido<meta name="Generator" content="makeinfo">
1353024Sguido<link href="#Top" rel="start" title="Top">
1453024Sguido<link href="dir.html#Top" rel="up" title="(dir)">
1553024Sguido<style type="text/css">
1653024Sguido<!--
1753024Sguidoa.summary-letter {text-decoration: none}
1853024Sguidoblockquote.indentedblock {margin-right: 0em}
1953024Sguidoblockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
2053024Sguidoblockquote.smallquotation {font-size: smaller}
2153024Sguidodiv.display {margin-left: 3.2em}
2253024Sguidodiv.example {margin-left: 3.2em}
2353024Sguidodiv.lisp {margin-left: 3.2em}
2453024Sguidodiv.smalldisplay {margin-left: 3.2em}
2553024Sguidodiv.smallexample {margin-left: 3.2em}
2653024Sguidodiv.smalllisp {margin-left: 3.2em}
2753024Sguidokbd {font-style: oblique}
2853024Sguidopre.display {font-family: inherit}
2953024Sguidopre.format {font-family: inherit}
3053024Sguidopre.menu-comment {font-family: serif}
3153024Sguidopre.menu-preformatted {font-family: serif}
3253024Sguidopre.smalldisplay {font-family: inherit; font-size: smaller}
3353024Sguidopre.smallexample {font-size: smaller}
3453024Sguidopre.smallformat {font-family: inherit; font-size: smaller}
3553024Sguidopre.smalllisp {font-size: smaller}
3653024Sguidospan.nolinebreak {white-space: nowrap}
3753024Sguidospan.roman {font-family: initial; font-weight: normal}
3853024Sguidospan.sansserif {font-family: sans-serif; font-weight: normal}
3953024Sguidoul.no-bullet {list-style: none}
4053024Sguido-->
4153024Sguido</style>
4253024Sguido
4353024Sguido
4453024Sguido</head>
4553024Sguido
4653024Sguido<body lang="en">
4753024Sguido<h1 class="settitle" align="center">ntpdc: NTPD Control User&rsquo;s Manual</h1>
4853024Sguido
4953024Sguido
5053024Sguido
5153024Sguido
5253024Sguido
5353024Sguido<a name="Top"></a>
5453024Sguido<div class="header">
5553024Sguido<p>
5653024SguidoNext: <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>
5753024Sguido</div>
5853024Sguido<a name="ntpdc_003a-NTPD-Control-User-Manual"></a>
5953024Sguido<h1 class="top">ntpdc: NTPD Control User Manual</h1>
6053024Sguido
6153024Sguido<p>This document describes the use of the NTP Project&rsquo;s <code>ntpdc</code> program,
6253024Sguidothat can be used to query a Network Time Protocol (NTP) server and
6353024Sguidodisplay the time offset of the system clock relative to the server
6453024Sguidoclock.  Run as root, it can correct the system clock to this offset as
6553024Sguidowell.  It can be run as an interactive command or from a cron job.
6653024Sguido</p>
6753024Sguido<p>This document applies to version 4.2.8p13 of <code>ntpdc</code>.
6853024Sguido</p>
6953024Sguido<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
7053024SguidoIETF specification.
7153024Sguido</p>
7253024Sguido<a name="SEC_Overview"></a>
7353024Sguido<h2 class="shortcontents-heading">Short Table of Contents</h2>
7453024Sguido
7553024Sguido<div class="shortcontents">
7653024Sguido<ul class="no-bullet">
7753024Sguido<li><a name="stoc-Description" href="#toc-Description">1 Description</a></li>
7853024Sguido</ul>
7953024Sguido</div>
8053024Sguido
8153024Sguido
8253024Sguido<table class="menu" border="0" cellspacing="0">
8353024Sguido<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
8453024Sguido</td></tr>
8553024Sguido<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
8653024Sguido</td></tr>
8753024Sguido<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
8853024Sguido</td></tr>
8953024Sguido</table>
9053024Sguido
9153024Sguido<hr>
9253024Sguido<a name="ntpdc-Description"></a>
9353024Sguido<div class="header">
9453024Sguido<p>
9553024SguidoNext: <a href="#ntpdc-Invocation" accesskey="n" rel="next">ntpdc Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
9653024Sguido</div>
9753024Sguido<a name="Description"></a>
9853024Sguido<h2 class="chapter">1 Description</h2>
9953024Sguido
10053024Sguido<p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
10153024Sguidostandard output in the format:
10253024Sguido</p>
10353024Sguido<div class="example">
10453024Sguido<pre class="example">1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
10553024Sguido</pre></div>
10653024Sguido
10753024Sguido<p>where
10853024SguidoYYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
10953024Sguido(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
11053024Sguidoand
11153024Sguidothe +4.567 +/- 0.089 secs indicates the time offset and
11253024Sguidoerror bound of the system clock relative to the server clock.
11353024Sguido</p>
11453024Sguido<table class="menu" border="0" cellspacing="0">
11553024Sguido<tr><td align="left" valign="top">&bull; <a href="#ntpdc-Invocation" accesskey="1">ntpdc Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
11653024Sguido</td></tr>
11753024Sguido<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
11853024Sguido</td></tr>
11953024Sguido</table>
12053024Sguido
12153024Sguido<hr>
12253024Sguido<a name="ntpdc-Invocation"></a>
12353024Sguido<div class="header">
12453024Sguido<p>
12553024SguidoNext: <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>
12653024Sguido</div>
12753024Sguido<a name="Invoking-ntpdc"></a>
12853024Sguido<h3 class="section">1.1 Invoking ntpdc</h3>
12953024Sguido<a name="index-ntpdc"></a>
13053024Sguido<a name="index-vendor_002dspecific-NTPD-control-program"></a>
13153024Sguido
13253024Sguido
13353024Sguido
13453024Sguido<p><code>ntpdc</code>
13553024Sguidois deprecated.
13653024SguidoPlease use
13753024Sguido<code>ntpq(1ntpqmdoc)</code> instead - it can do everything
13853024Sguido<code>ntpdc</code>
13953024Sguidoused to do, and it does so using a much more sane interface.
14053024Sguido</p>
14153024Sguido<p><code>ntpdc</code>
14253024Sguidois a utility program used to query
14353024Sguido<code>ntpd(1ntpdmdoc)</code>
14453024Sguidoabout its
14553024Sguidocurrent state and to request changes in that state.
14653024SguidoIt uses NTP mode 7 control message formats described in the source code.
14753024SguidoThe program may
14853024Sguidobe run either in interactive mode or controlled using command line
14953024Sguidoarguments.
15053024SguidoExtensive state and statistics information is available
15153024Sguidothrough the
15253024Sguido<code>ntpdc</code>
15353024Sguidointerface.
15453024SguidoIn addition, nearly all the
15553024Sguidoconfiguration options which can be specified at startup using
15653024Sguidontpd&rsquo;s configuration file may also be specified at run time using
15753024Sguido<code>ntpdc</code>
15853024Sguido</p>
15953024Sguido<p>This section was generated by <strong>AutoGen</strong>,
16053024Sguidousing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
16153024SguidoThis software is released under the NTP license, &lt;http://ntp.org/license>;.
16253024Sguido</p>
16353024Sguido<table class="menu" border="0" cellspacing="0">
16453024Sguido<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>)
16553024Sguido</td></tr>
16653024Sguido<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)
16753024Sguido</td></tr>
16853024Sguido<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)
16953024Sguido</td></tr>
17053024Sguido<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)
17153024Sguido</td></tr>
17253024Sguido<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)
17353024Sguido</td></tr>
17453024Sguido<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)
17553024Sguido</td></tr>
17653024Sguido<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)
17753024Sguido</td></tr>
17853024Sguido<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)
17953024Sguido</td></tr>
18053024Sguido<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)
18153024Sguido</td></tr>
18253024Sguido<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
18353024Sguido</td></tr>
18453024Sguido<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
18553024Sguido</td></tr>
18653024Sguido<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
18753024Sguido</td></tr>
18853024Sguido<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
18953024Sguido</td></tr>
19053024Sguido<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
19153024Sguido</td></tr>
19253024Sguido<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
19353024Sguido</td></tr>
19453024Sguido</table>
19553024Sguido
19653024Sguido<hr>
19753024Sguido<a name="ntpdc-usage"></a>
19853024Sguido<div class="header">
19953024Sguido<p>
20053024SguidoNext: <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>
20153024Sguido</div>
20253024Sguido<a name="ntpdc-help_002fusage-_0028_002d_002dhelp_0029"></a>
20353024Sguido<h4 class="subsection">1.1.1 ntpdc help/usage (<samp>--help</samp>)</h4>
204<a name="index-ntpdc-help"></a>
205
206<p>This is the automatically generated usage text for ntpdc.
207</p>
208<p>The text printed is the same whether selected with the <code>help</code> option
209(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
210the usage text by passing it through a pager program.
211<code>more-help</code> is disabled on platforms without a working
212<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
213used to select the program, defaulting to <samp>more</samp>.  Both will exit
214with a status code of 0.
215</p>
216<div class="example">
217<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13
218Usage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
219  Flg Arg Option-Name    Description
220   -4 no  ipv4           Force IPv4 DNS name resolution
221                                - prohibits the option 'ipv6'
222   -6 no  ipv6           Force IPv6 DNS name resolution
223                                - prohibits the option 'ipv4'
224   -c Str command        run a command and exit
225                                - may appear multiple times
226   -d no  debug-level    Increase debug verbosity level
227                                - may appear multiple times
228   -D Num set-debug-level Set the debug verbosity level
229                                - may appear multiple times
230   -i no  interactive    Force ntpq to operate in interactive mode
231                                - prohibits these options:
232                                command
233                                listpeers
234                                peers
235                                showpeers
236   -l no  listpeers      Print a list of the peers
237                                - prohibits the option 'command'
238   -n no  numeric        numeric host addresses
239   -p no  peers          Print a list of the peers
240                                - prohibits the option 'command'
241   -s no  showpeers      Show a list of the peers
242                                - prohibits the option 'command'
243      opt version        output version information and exit
244   -? no  help           display extended usage information and exit
245   -! no  more-help      extended usage information passed thru pager
246   -&gt; opt save-opts      save the option state to a config file
247   -&lt; Str load-opts      load options from a config file
248                                - disabled as '--no-load-opts'
249                                - may appear multiple times
250
251Options are specified by doubled hyphens and their name or by a single
252hyphen and the flag character.
253
254
255The following option preset mechanisms are supported:
256 - reading file $HOME/.ntprc
257 - reading file ./.ntprc
258 - examining environment variables named NTPDC_*
259
260Please send bug reports to:  &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
261</pre></div>
262
263<hr>
264<a name="ntpdc-ipv4"></a>
265<div class="header">
266<p>
267Next: <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>
268</div>
269<a name="ipv4-option-_0028_002d4_0029"></a>
270<h4 class="subsection">1.1.2 ipv4 option (-4)</h4>
271<a name="index-ntpdc_002dipv4"></a>
272
273<p>This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
274</p>
275<p>This option has some usage constraints.  It:
276</p><ul>
277<li> must not appear in combination with any of the following options:
278ipv6.
279</li></ul>
280
281<p>Force DNS resolution of following host names on the command line
282to the IPv4 namespace.
283</p><hr>
284<a name="ntpdc-ipv6"></a>
285<div class="header">
286<p>
287Next: <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>
288</div>
289<a name="ipv6-option-_0028_002d6_0029"></a>
290<h4 class="subsection">1.1.3 ipv6 option (-6)</h4>
291<a name="index-ntpdc_002dipv6"></a>
292
293<p>This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
294</p>
295<p>This option has some usage constraints.  It:
296</p><ul>
297<li> must not appear in combination with any of the following options:
298ipv4.
299</li></ul>
300
301<p>Force DNS resolution of following host names on the command line
302to the IPv6 namespace.
303</p><hr>
304<a name="ntpdc-command"></a>
305<div class="header">
306<p>
307Next: <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>
308</div>
309<a name="command-option-_0028_002dc_0029"></a>
310<h4 class="subsection">1.1.4 command option (-c)</h4>
311<a name="index-ntpdc_002dcommand"></a>
312
313<p>This is the &ldquo;run a command and exit&rdquo; option.
314This option takes a string argument <samp>cmd</samp>.
315</p>
316<p>This option has some usage constraints.  It:
317</p><ul>
318<li> may appear an unlimited number of times.
319</li></ul>
320
321<p>The following argument is interpreted as an interactive format command
322and is added to the list of commands to be executed on the specified
323host(s).
324</p><hr>
325<a name="ntpdc-interactive"></a>
326<div class="header">
327<p>
328Next: <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>
329</div>
330<a name="interactive-option-_0028_002di_0029"></a>
331<h4 class="subsection">1.1.5 interactive option (-i)</h4>
332<a name="index-ntpdc_002dinteractive"></a>
333
334<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
335</p>
336<p>This option has some usage constraints.  It:
337</p><ul>
338<li> must not appear in combination with any of the following options:
339command, listpeers, peers, showpeers.
340</li></ul>
341
342<p>Force ntpq to operate in interactive mode.  Prompts will be written
343to the standard output and commands read from the standard input.
344</p><hr>
345<a name="ntpdc-listpeers"></a>
346<div class="header">
347<p>
348Next: <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>
349</div>
350<a name="listpeers-option-_0028_002dl_0029"></a>
351<h4 class="subsection">1.1.6 listpeers option (-l)</h4>
352<a name="index-ntpdc_002dlistpeers"></a>
353
354<p>This is the &ldquo;print a list of the peers&rdquo; option.
355</p>
356<p>This option has some usage constraints.  It:
357</p><ul>
358<li> must not appear in combination with any of the following options:
359command.
360</li></ul>
361
362<p>Print a list of the peers known to the server as well as a summary of
363their state. This is equivalent to the &rsquo;listpeers&rsquo; interactive command.
364</p><hr>
365<a name="ntpdc-numeric"></a>
366<div class="header">
367<p>
368Next: <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>
369</div>
370<a name="numeric-option-_0028_002dn_0029"></a>
371<h4 class="subsection">1.1.7 numeric option (-n)</h4>
372<a name="index-ntpdc_002dnumeric"></a>
373
374<p>This is the &ldquo;numeric host addresses&rdquo; option.
375Output all host addresses in dotted-quad numeric format rather than
376converting to the canonical host names. 
377</p><hr>
378<a name="ntpdc-peers"></a>
379<div class="header">
380<p>
381Next: <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>
382</div>
383<a name="peers-option-_0028_002dp_0029"></a>
384<h4 class="subsection">1.1.8 peers option (-p)</h4>
385<a name="index-ntpdc_002dpeers"></a>
386
387<p>This is the &ldquo;print a list of the peers&rdquo; option.
388</p>
389<p>This option has some usage constraints.  It:
390</p><ul>
391<li> must not appear in combination with any of the following options:
392command.
393</li></ul>
394
395<p>Print a list of the peers known to the server as well as a summary
396of their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
397</p><hr>
398<a name="ntpdc-showpeers"></a>
399<div class="header">
400<p>
401Next: <a href="#ntpdc-config" accesskey="n" rel="next">ntpdc config</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>
402</div>
403<a name="showpeers-option-_0028_002ds_0029"></a>
404<h4 class="subsection">1.1.9 showpeers option (-s)</h4>
405<a name="index-ntpdc_002dshowpeers"></a>
406
407<p>This is the &ldquo;show a list of the peers&rdquo; option.
408</p>
409<p>This option has some usage constraints.  It:
410</p><ul>
411<li> must not appear in combination with any of the following options:
412command.
413</li></ul>
414
415<p>Print a list of the peers known to the server as well as a summary
416of their state. This is equivalent to the &rsquo;dmpeers&rsquo; interactive command.
417</p>
418
419<hr>
420<a name="ntpdc-config"></a>
421<div class="header">
422<p>
423Next: <a href="#ntpdc-exit-status" accesskey="n" rel="next">ntpdc exit status</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>
424</div>
425<a name="presetting_002fconfiguring-ntpdc"></a>
426<h4 class="subsection">1.1.10 presetting/configuring ntpdc</h4>
427
428<p>Any option that is not marked as <i>not presettable</i> may be preset by
429loading 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
430the options listed above in upper case and segmented with underscores.
431The <code>NTPDC</code> variable will be tokenized and parsed like
432the command line.  The remaining variables are tested for existence and their
433values are treated like option arguments.
434</p>
435
436<p><code>libopts</code> will search in 2 places for configuration files:
437</p><ul>
438<li> $HOME
439</li><li> $PWD
440</li></ul>
441<p>The environment variables <code>HOME</code>, and <code>PWD</code>
442are expanded and replaced when <samp>ntpdc</samp> runs.
443For any of these that are plain files, they are simply processed.
444For any that are directories, then a file named <samp>.ntprc</samp> is searched for
445within that directory and processed.
446</p>
447<p>Configuration files may be in a wide variety of formats.
448The basic format is an option name followed by a value (argument) on the
449same line.  Values may be separated from the option name with a colon,
450equal sign or simply white space.  Values may be continued across multiple
451lines by escaping the newline with a backslash.
452</p>
453<p>Multiple programs may also share the same initialization file.
454Common options are collected at the top, followed by program specific
455segments.  The segments are separated by lines like:
456</p><div class="example">
457<pre class="example">[NTPDC]
458</pre></div>
459<p>or by
460</p><div class="example">
461<pre class="example">&lt;?program ntpdc&gt;
462</pre></div>
463<p>Do not mix these styles within one configuration file.
464</p>
465<p>Compound values and carefully constructed string values may also be
466specified using XML syntax:
467</p><div class="example">
468<pre class="example">&lt;option-name&gt;
469   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
470&lt;/option-name&gt;
471</pre></div>
472<p>yielding an <code>option-name.sub-opt</code> string value of
473</p><div class="example">
474<pre class="example">&quot;...&lt;...&gt;...&quot;
475</pre></div>
476<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
477hierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
478the associated name/value pair list (see: optionFindValue).
479</p>
480<p>The command line options relating to configuration and/or usage help are:
481</p>
482<a name="version-_0028_002d_0029"></a>
483<h4 class="subsubheading">version (-)</h4>
484
485<p>Print the program version to standard out, optionally with licensing
486information, then exit 0.  The optional argument specifies how much licensing
487detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.
488Only the first letter of the argument is examined:
489</p>
490<dl compact="compact">
491<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
492<dd><p>Only print the version.  This is the default.
493</p></dd>
494<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
495<dd><p>Name the copyright usage licensing terms.
496</p></dd>
497<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
498<dd><p>Print the full copyright usage licensing terms.
499</p></dd>
500</dl>
501
502<hr>
503<a name="ntpdc-exit-status"></a>
504<div class="header">
505<p>
506Next: <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>
507</div>
508<a name="ntpdc-exit-status-1"></a>
509<h4 class="subsection">1.1.11 ntpdc exit status</h4>
510
511<p>One of the following exit values will be returned:
512</p><dl compact="compact">
513<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
514<dd><p>Successful program execution.
515</p></dd>
516<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
517<dd><p>The operation failed or the command syntax was not valid.
518</p></dd>
519<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
520<dd><p>A specified configuration file could not be loaded.
521</p></dd>
522<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
523<dd><p>libopts had an internal operational error.  Please report
524it to autogen-users@lists.sourceforge.net.  Thank you.
525</p></dd>
526</dl>
527<hr>
528<a name="ntpdc-Usage"></a>
529<div class="header">
530<p>
531Next: <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>
532</div>
533<a name="ntpdc-Usage-1"></a>
534<h4 class="subsection">1.1.12 ntpdc Usage</h4>
535<hr>
536<a name="ntpdc-See-Also"></a>
537<div class="header">
538<p>
539Next: <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>
540</div>
541<a name="ntpdc-See-Also-1"></a>
542<h4 class="subsection">1.1.13 ntpdc See Also</h4>
543<hr>
544<a name="ntpdc-Authors"></a>
545<div class="header">
546<p>
547Next: <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>
548</div>
549<a name="ntpdc-Authors-1"></a>
550<h4 class="subsection">1.1.14 ntpdc Authors</h4>
551<hr>
552<a name="ntpdc-Bugs"></a>
553<div class="header">
554<p>
555Previous: <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>
556</div>
557<a name="ntpdc-Bugs-1"></a>
558<h4 class="subsection">1.1.15 ntpdc Bugs</h4>
559
560<hr>
561<a name="Usage"></a>
562<div class="header">
563<p>
564Previous: <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>
565</div>
566<a name="Usage-1"></a>
567<h3 class="section">1.2 Usage</h3>
568
569<p>The simplest use of this program is as an unprivileged command to
570check the current time, offset, and error in the local clock.
571For example:
572</p>
573<div class="example">
574<pre class="example">ntpdc ntpserver.somewhere
575</pre></div>
576
577<p>With suitable privilege, it can be run as a command or in a
578<code>cron</code> job to reset the local clock from a reliable server, like
579the <code>ntpdate</code> and <code>rdate</code> commands.
580For example:
581</p>
582<div class="example">
583<pre class="example">ntpdc -a ntpserver.somewhere
584</pre></div>
585<hr>
586
587
588
589</body>
590</html>
591