Home | History | Annotate | Line # | Download | only in ntpdc
      1  1.1.1.13  christos <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2  1.1.1.13  christos <html>
      3  1.1.1.15  christos <!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
      4       1.1  christos <head>
      5  1.1.1.13  christos <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      6  1.1.1.13  christos <title>ntpdc: NTPD Control User&rsquo;s Manual</title>
      7  1.1.1.13  christos 
      8  1.1.1.13  christos <meta name="description" content="ntpdc: NTPD Control User&rsquo;s Manual">
      9  1.1.1.13  christos <meta name="keywords" content="ntpdc: NTPD Control User&rsquo;s Manual">
     10  1.1.1.13  christos <meta name="resource-type" content="document">
     11  1.1.1.13  christos <meta name="distribution" content="global">
     12  1.1.1.13  christos <meta name="Generator" content="makeinfo">
     13  1.1.1.13  christos <link href="#Top" rel="start" title="Top">
     14  1.1.1.13  christos <link href="dir.html#Top" rel="up" title="(dir)">
     15  1.1.1.13  christos <style type="text/css">
     16  1.1.1.13  christos <!--
     17  1.1.1.13  christos a.summary-letter {text-decoration: none}
     18  1.1.1.13  christos blockquote.indentedblock {margin-right: 0em}
     19  1.1.1.13  christos div.display {margin-left: 3.2em}
     20  1.1.1.13  christos div.example {margin-left: 3.2em}
     21  1.1.1.13  christos div.lisp {margin-left: 3.2em}
     22  1.1.1.13  christos kbd {font-style: oblique}
     23  1.1.1.13  christos pre.display {font-family: inherit}
     24  1.1.1.13  christos pre.format {font-family: inherit}
     25  1.1.1.13  christos pre.menu-comment {font-family: serif}
     26  1.1.1.13  christos pre.menu-preformatted {font-family: serif}
     27  1.1.1.13  christos span.nolinebreak {white-space: nowrap}
     28  1.1.1.13  christos span.roman {font-family: initial; font-weight: normal}
     29  1.1.1.13  christos span.sansserif {font-family: sans-serif; font-weight: normal}
     30  1.1.1.13  christos ul.no-bullet {list-style: none}
     31  1.1.1.13  christos -->
     32  1.1.1.13  christos </style>
     33  1.1.1.13  christos 
     34  1.1.1.13  christos 
     35       1.1  christos </head>
     36       1.1  christos 
     37  1.1.1.13  christos <body lang="en">
     38  1.1.1.13  christos <h1 class="settitle" align="center">ntpdc: NTPD Control User&rsquo;s Manual</h1>
     39  1.1.1.13  christos 
     40  1.1.1.13  christos 
     41  1.1.1.13  christos 
     42  1.1.1.13  christos 
     43       1.1  christos 
     44  1.1.1.15  christos <span id="Top"></span><div class="header">
     45  1.1.1.13  christos <p>
     46  1.1.1.13  christos Next: <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>
     47  1.1.1.13  christos </div>
     48  1.1.1.15  christos <span id="ntpdc_003a-NTPD-Control-User-Manual"></span><h1 class="top">ntpdc: NTPD Control User Manual</h1>
     49  1.1.1.13  christos 
     50  1.1.1.13  christos <p>This document describes the use of the NTP Project&rsquo;s <code>ntpdc</code> program,
     51       1.1  christos that can be used to query a Network Time Protocol (NTP) server and
     52       1.1  christos display the time offset of the system clock relative to the server
     53       1.1  christos clock.  Run as root, it can correct the system clock to this offset as
     54       1.1  christos well.  It can be run as an interactive command or from a cron job.
     55  1.1.1.13  christos </p>
     56  1.1.1.15  christos <p>This document applies to version 4.2.8p18 of <code>ntpdc</code>.
     57  1.1.1.13  christos </p>
     58  1.1.1.13  christos <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
     59       1.1  christos IETF specification.
     60  1.1.1.13  christos </p>
     61  1.1.1.15  christos <span id="SEC_Overview"></span>
     62  1.1.1.13  christos <h2 class="shortcontents-heading">Short Table of Contents</h2>
     63       1.1  christos 
     64  1.1.1.13  christos <div class="shortcontents">
     65  1.1.1.13  christos <ul class="no-bullet">
     66  1.1.1.15  christos <li><a id="stoc-Description" href="#toc-Description">1 Description</a></li>
     67       1.1  christos </ul>
     68       1.1  christos </div>
     69       1.1  christos 
     70       1.1  christos 
     71  1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
     72  1.1.1.15  christos <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
     73  1.1.1.13  christos </td></tr>
     74  1.1.1.15  christos <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
     75  1.1.1.13  christos </td></tr>
     76  1.1.1.15  christos <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
     77  1.1.1.13  christos </td></tr>
     78  1.1.1.13  christos </table>
     79  1.1.1.13  christos 
     80  1.1.1.13  christos <hr>
     81  1.1.1.15  christos <span id="ntpdc-Description"></span><div class="header">
     82  1.1.1.13  christos <p>
     83  1.1.1.13  christos Next: <a href="#ntpdc-Invocation" accesskey="n" rel="next">ntpdc Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
     84       1.1  christos </div>
     85  1.1.1.15  christos <span id="Description"></span><h2 class="chapter">1 Description</h2>
     86       1.1  christos 
     87       1.1  christos <p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
     88       1.1  christos standard output in the format:
     89  1.1.1.13  christos </p>
     90  1.1.1.13  christos <div class="example">
     91  1.1.1.13  christos <pre class="example">1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
     92  1.1.1.13  christos </pre></div>
     93       1.1  christos 
     94  1.1.1.13  christos <p>where
     95       1.1  christos YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
     96       1.1  christos (+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
     97       1.1  christos and
     98       1.1  christos the +4.567 +/- 0.089 secs indicates the time offset and
     99       1.1  christos error bound of the system clock relative to the server clock.
    100  1.1.1.13  christos </p>
    101  1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
    102  1.1.1.15  christos <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">
    103  1.1.1.13  christos </td></tr>
    104  1.1.1.15  christos <tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    105  1.1.1.13  christos </td></tr>
    106  1.1.1.13  christos </table>
    107       1.1  christos 
    108  1.1.1.13  christos <hr>
    109  1.1.1.15  christos <span id="ntpdc-Invocation"></span><div class="header">
    110  1.1.1.13  christos <p>
    111  1.1.1.13  christos Next: <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>
    112       1.1  christos </div>
    113  1.1.1.15  christos <span id="Invoking-ntpdc"></span><h3 class="section">1.1 Invoking ntpdc</h3>
    114  1.1.1.15  christos <span id="index-ntpdc"></span>
    115  1.1.1.15  christos <span id="index-vendor_002dspecific-NTPD-control-program"></span>
    116       1.1  christos 
    117       1.1  christos 
    118       1.1  christos 
    119  1.1.1.13  christos <p><code>ntpdc</code>
    120  1.1.1.13  christos is deprecated.
    121   1.1.1.2  christos Please use
    122   1.1.1.2  christos <code>ntpq(1ntpqmdoc)</code> instead - it can do everything
    123   1.1.1.2  christos <code>ntpdc</code>
    124   1.1.1.2  christos used to do, and it does so using a much more sane interface.
    125  1.1.1.13  christos </p>
    126  1.1.1.13  christos <p><code>ntpdc</code>
    127       1.1  christos is a utility program used to query
    128       1.1  christos <code>ntpd(1ntpdmdoc)</code>
    129       1.1  christos about its
    130  1.1.1.13  christos current state and to request changes in that state.
    131  1.1.1.13  christos It uses NTP mode 7 control message formats described in the source code.
    132       1.1  christos The program may
    133       1.1  christos be run either in interactive mode or controlled using command line
    134  1.1.1.13  christos arguments.
    135       1.1  christos Extensive state and statistics information is available
    136       1.1  christos through the
    137       1.1  christos <code>ntpdc</code>
    138  1.1.1.13  christos interface.
    139       1.1  christos In addition, nearly all the
    140       1.1  christos configuration options which can be specified at startup using
    141  1.1.1.13  christos ntpd&rsquo;s configuration file may also be specified at run time using
    142       1.1  christos <code>ntpdc</code>
    143  1.1.1.13  christos </p>
    144  1.1.1.13  christos <p>This section was generated by <strong>AutoGen</strong>,
    145  1.1.1.13  christos using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
    146       1.1  christos This software is released under the NTP license, &lt;http://ntp.org/license>;.
    147  1.1.1.13  christos </p>
    148  1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
    149  1.1.1.15  christos <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>)
    150  1.1.1.13  christos </td></tr>
    151  1.1.1.15  christos <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)
    152  1.1.1.13  christos </td></tr>
    153  1.1.1.15  christos <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)
    154  1.1.1.13  christos </td></tr>
    155  1.1.1.15  christos <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)
    156  1.1.1.13  christos </td></tr>
    157  1.1.1.15  christos <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)
    158  1.1.1.13  christos </td></tr>
    159  1.1.1.15  christos <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)
    160  1.1.1.13  christos </td></tr>
    161  1.1.1.15  christos <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)
    162  1.1.1.13  christos </td></tr>
    163  1.1.1.15  christos <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)
    164  1.1.1.13  christos </td></tr>
    165  1.1.1.15  christos <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)
    166  1.1.1.13  christos </td></tr>
    167  1.1.1.15  christos <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)
    168  1.1.1.13  christos </td></tr>
    169  1.1.1.15  christos <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
    170  1.1.1.13  christos </td></tr>
    171  1.1.1.15  christos <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
    172  1.1.1.13  christos </td></tr>
    173  1.1.1.15  christos <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
    174  1.1.1.13  christos </td></tr>
    175  1.1.1.15  christos <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
    176  1.1.1.13  christos </td></tr>
    177  1.1.1.15  christos <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  1.1.1.15  christos </td></tr>
    179  1.1.1.15  christos <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
    180  1.1.1.13  christos </td></tr>
    181  1.1.1.13  christos </table>
    182  1.1.1.13  christos 
    183  1.1.1.13  christos <hr>
    184  1.1.1.15  christos <span id="ntpdc-usage"></span><div class="header">
    185  1.1.1.13  christos <p>
    186  1.1.1.13  christos Next: <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>
    187  1.1.1.13  christos </div>
    188  1.1.1.15  christos <span id="ntpdc-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1.1 ntpdc help/usage (<samp>--help</samp>)</h4>
    189  1.1.1.15  christos <span id="index-ntpdc-help"></span>
    190  1.1.1.13  christos 
    191  1.1.1.13  christos <p>This is the automatically generated usage text for ntpdc.
    192  1.1.1.13  christos </p>
    193  1.1.1.13  christos <p>The text printed is the same whether selected with the <code>help</code> option
    194  1.1.1.13  christos (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
    195  1.1.1.13  christos the usage text by passing it through a pager program.
    196       1.1  christos <code>more-help</code> is disabled on platforms without a working
    197       1.1  christos <code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
    198  1.1.1.13  christos used to select the program, defaulting to <samp>more</samp>.  Both will exit
    199       1.1  christos with a status code of 0.
    200  1.1.1.13  christos </p>
    201  1.1.1.13  christos <div class="example">
    202  1.1.1.15  christos <pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18
    203       1.1  christos Usage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
    204       1.1  christos   Flg Arg Option-Name    Description
    205       1.1  christos    -4 no  ipv4           Force IPv4 DNS name resolution
    206       1.1  christos                                 - prohibits the option 'ipv6'
    207       1.1  christos    -6 no  ipv6           Force IPv6 DNS name resolution
    208       1.1  christos                                 - prohibits the option 'ipv4'
    209       1.1  christos    -c Str command        run a command and exit
    210       1.1  christos                                 - may appear multiple times
    211       1.1  christos    -d no  debug-level    Increase debug verbosity level
    212       1.1  christos                                 - may appear multiple times
    213       1.1  christos    -D Num set-debug-level Set the debug verbosity level
    214       1.1  christos                                 - may appear multiple times
    215       1.1  christos    -i no  interactive    Force ntpq to operate in interactive mode
    216       1.1  christos                                 - prohibits these options:
    217       1.1  christos                                 command
    218       1.1  christos                                 listpeers
    219       1.1  christos                                 peers
    220       1.1  christos                                 showpeers
    221       1.1  christos    -l no  listpeers      Print a list of the peers
    222       1.1  christos                                 - prohibits the option 'command'
    223       1.1  christos    -n no  numeric        numeric host addresses
    224       1.1  christos    -p no  peers          Print a list of the peers
    225       1.1  christos                                 - prohibits the option 'command'
    226       1.1  christos    -s no  showpeers      Show a list of the peers
    227       1.1  christos                                 - prohibits the option 'command'
    228  1.1.1.15  christos    -u no  unconnected    Use unconnected UDP to communicate with ntpd (default on Windows)
    229       1.1  christos       opt version        output version information and exit
    230       1.1  christos    -? no  help           display extended usage information and exit
    231       1.1  christos    -! no  more-help      extended usage information passed thru pager
    232       1.1  christos    -&gt; opt save-opts      save the option state to a config file
    233       1.1  christos    -&lt; Str load-opts      load options from a config file
    234       1.1  christos                                 - disabled as '--no-load-opts'
    235       1.1  christos                                 - may appear multiple times
    236       1.1  christos 
    237       1.1  christos Options are specified by doubled hyphens and their name or by a single
    238       1.1  christos hyphen and the flag character.
    239       1.1  christos 
    240       1.1  christos 
    241       1.1  christos The following option preset mechanisms are supported:
    242       1.1  christos  - reading file $HOME/.ntprc
    243       1.1  christos  - reading file ./.ntprc
    244       1.1  christos  - examining environment variables named NTPDC_*
    245       1.1  christos 
    246  1.1.1.15  christos Please send bug reports to:  &lt;https://bugs.ntp.org, bugs (a] ntp.org&gt;
    247  1.1.1.13  christos </pre></div>
    248       1.1  christos 
    249  1.1.1.13  christos <hr>
    250  1.1.1.15  christos <span id="ntpdc-ipv4"></span><div class="header">
    251  1.1.1.13  christos <p>
    252  1.1.1.13  christos Next: <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>
    253  1.1.1.13  christos </div>
    254  1.1.1.15  christos <span id="ipv4-option-_0028_002d4_0029"></span><h4 class="subsection">1.1.2 ipv4 option (-4)</h4>
    255  1.1.1.15  christos <span id="index-ntpdc_002dipv4"></span>
    256  1.1.1.13  christos 
    257  1.1.1.13  christos <p>This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
    258  1.1.1.13  christos </p>
    259  1.1.1.13  christos <p>This option has some usage constraints.  It:
    260  1.1.1.13  christos </p><ul>
    261  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    262  1.1.1.13  christos ipv6.
    263  1.1.1.13  christos </li></ul>
    264  1.1.1.13  christos 
    265  1.1.1.13  christos <p>Force DNS resolution of following host names on the command line
    266  1.1.1.13  christos to the IPv4 namespace.
    267  1.1.1.13  christos </p><hr>
    268  1.1.1.15  christos <span id="ntpdc-ipv6"></span><div class="header">
    269  1.1.1.13  christos <p>
    270  1.1.1.13  christos Next: <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>
    271  1.1.1.13  christos </div>
    272  1.1.1.15  christos <span id="ipv6-option-_0028_002d6_0029"></span><h4 class="subsection">1.1.3 ipv6 option (-6)</h4>
    273  1.1.1.15  christos <span id="index-ntpdc_002dipv6"></span>
    274  1.1.1.13  christos 
    275  1.1.1.13  christos <p>This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
    276  1.1.1.13  christos </p>
    277  1.1.1.13  christos <p>This option has some usage constraints.  It:
    278  1.1.1.13  christos </p><ul>
    279  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    280  1.1.1.13  christos ipv4.
    281  1.1.1.13  christos </li></ul>
    282  1.1.1.13  christos 
    283  1.1.1.13  christos <p>Force DNS resolution of following host names on the command line
    284  1.1.1.13  christos to the IPv6 namespace.
    285  1.1.1.13  christos </p><hr>
    286  1.1.1.15  christos <span id="ntpdc-command"></span><div class="header">
    287  1.1.1.13  christos <p>
    288  1.1.1.13  christos Next: <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>
    289  1.1.1.13  christos </div>
    290  1.1.1.15  christos <span id="command-option-_0028_002dc_0029"></span><h4 class="subsection">1.1.4 command option (-c)</h4>
    291  1.1.1.15  christos <span id="index-ntpdc_002dcommand"></span>
    292  1.1.1.13  christos 
    293  1.1.1.13  christos <p>This is the &ldquo;run a command and exit&rdquo; option.
    294  1.1.1.13  christos This option takes a string argument <samp>cmd</samp>.
    295  1.1.1.13  christos </p>
    296  1.1.1.13  christos <p>This option has some usage constraints.  It:
    297  1.1.1.13  christos </p><ul>
    298  1.1.1.13  christos <li> may appear an unlimited number of times.
    299  1.1.1.13  christos </li></ul>
    300       1.1  christos 
    301  1.1.1.13  christos <p>The following argument is interpreted as an interactive format command
    302       1.1  christos and is added to the list of commands to be executed on the specified
    303  1.1.1.13  christos host(s).
    304  1.1.1.13  christos </p><hr>
    305  1.1.1.15  christos <span id="ntpdc-interactive"></span><div class="header">
    306  1.1.1.13  christos <p>
    307  1.1.1.13  christos Next: <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>
    308  1.1.1.13  christos </div>
    309  1.1.1.15  christos <span id="interactive-option-_0028_002di_0029"></span><h4 class="subsection">1.1.5 interactive option (-i)</h4>
    310  1.1.1.15  christos <span id="index-ntpdc_002dinteractive"></span>
    311  1.1.1.13  christos 
    312  1.1.1.13  christos <p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
    313  1.1.1.13  christos </p>
    314  1.1.1.13  christos <p>This option has some usage constraints.  It:
    315  1.1.1.13  christos </p><ul>
    316  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    317  1.1.1.13  christos command, listpeers, peers, showpeers.
    318  1.1.1.13  christos </li></ul>
    319  1.1.1.13  christos 
    320  1.1.1.13  christos <p>Force ntpq to operate in interactive mode.  Prompts will be written
    321  1.1.1.13  christos to the standard output and commands read from the standard input.
    322  1.1.1.13  christos </p><hr>
    323  1.1.1.15  christos <span id="ntpdc-listpeers"></span><div class="header">
    324  1.1.1.13  christos <p>
    325  1.1.1.13  christos Next: <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>
    326  1.1.1.13  christos </div>
    327  1.1.1.15  christos <span id="listpeers-option-_0028_002dl_0029"></span><h4 class="subsection">1.1.6 listpeers option (-l)</h4>
    328  1.1.1.15  christos <span id="index-ntpdc_002dlistpeers"></span>
    329  1.1.1.13  christos 
    330  1.1.1.13  christos <p>This is the &ldquo;print a list of the peers&rdquo; option.
    331  1.1.1.13  christos </p>
    332  1.1.1.13  christos <p>This option has some usage constraints.  It:
    333  1.1.1.13  christos </p><ul>
    334  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    335  1.1.1.13  christos command.
    336  1.1.1.13  christos </li></ul>
    337  1.1.1.13  christos 
    338  1.1.1.13  christos <p>Print a list of the peers known to the server as well as a summary of
    339  1.1.1.13  christos their state. This is equivalent to the &rsquo;listpeers&rsquo; interactive command.
    340  1.1.1.13  christos </p><hr>
    341  1.1.1.15  christos <span id="ntpdc-numeric"></span><div class="header">
    342  1.1.1.13  christos <p>
    343  1.1.1.13  christos Next: <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>
    344  1.1.1.13  christos </div>
    345  1.1.1.15  christos <span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.7 numeric option (-n)</h4>
    346  1.1.1.15  christos <span id="index-ntpdc_002dnumeric"></span>
    347       1.1  christos 
    348  1.1.1.13  christos <p>This is the &ldquo;numeric host addresses&rdquo; option.
    349       1.1  christos Output all host addresses in dotted-quad numeric format rather than
    350       1.1  christos converting to the canonical host names. 
    351  1.1.1.13  christos </p><hr>
    352  1.1.1.15  christos <span id="ntpdc-peers"></span><div class="header">
    353  1.1.1.13  christos <p>
    354  1.1.1.13  christos Next: <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>
    355  1.1.1.13  christos </div>
    356  1.1.1.15  christos <span id="peers-option-_0028_002dp_0029"></span><h4 class="subsection">1.1.8 peers option (-p)</h4>
    357  1.1.1.15  christos <span id="index-ntpdc_002dpeers"></span>
    358  1.1.1.13  christos 
    359  1.1.1.13  christos <p>This is the &ldquo;print a list of the peers&rdquo; option.
    360  1.1.1.13  christos </p>
    361  1.1.1.13  christos <p>This option has some usage constraints.  It:
    362  1.1.1.13  christos </p><ul>
    363  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    364  1.1.1.13  christos command.
    365  1.1.1.13  christos </li></ul>
    366  1.1.1.13  christos 
    367  1.1.1.13  christos <p>Print a list of the peers known to the server as well as a summary
    368  1.1.1.13  christos of their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
    369  1.1.1.13  christos </p><hr>
    370  1.1.1.15  christos <span id="ntpdc-showpeers"></span><div class="header">
    371  1.1.1.13  christos <p>
    372  1.1.1.15  christos Next: <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>
    373  1.1.1.13  christos </div>
    374  1.1.1.15  christos <span id="showpeers-option-_0028_002ds_0029"></span><h4 class="subsection">1.1.9 showpeers option (-s)</h4>
    375  1.1.1.15  christos <span id="index-ntpdc_002dshowpeers"></span>
    376  1.1.1.13  christos 
    377  1.1.1.13  christos <p>This is the &ldquo;show a list of the peers&rdquo; option.
    378  1.1.1.13  christos </p>
    379  1.1.1.13  christos <p>This option has some usage constraints.  It:
    380  1.1.1.13  christos </p><ul>
    381  1.1.1.13  christos <li> must not appear in combination with any of the following options:
    382  1.1.1.13  christos command.
    383  1.1.1.13  christos </li></ul>
    384  1.1.1.13  christos 
    385  1.1.1.13  christos <p>Print a list of the peers known to the server as well as a summary
    386  1.1.1.13  christos of their state. This is equivalent to the &rsquo;dmpeers&rsquo; interactive command.
    387  1.1.1.15  christos </p><hr>
    388  1.1.1.15  christos <span id="ntpdc-unconnected"></span><div class="header">
    389  1.1.1.15  christos <p>
    390  1.1.1.15  christos Next: <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  1.1.1.15  christos </div>
    392  1.1.1.15  christos <span id="unconnected-option-_0028_002du_0029"></span><h4 class="subsection">1.1.10 unconnected option (-u)</h4>
    393  1.1.1.15  christos <span id="index-ntpdc_002dunconnected"></span>
    394  1.1.1.15  christos 
    395  1.1.1.15  christos <p>This is the &ldquo;use unconnected udp to communicate with ntpd (default on windows)&rdquo; option.
    396  1.1.1.15  christos Open an unconnected UDP association to ntpd (the default
    397  1.1.1.15  christos on Windows).
    398  1.1.1.13  christos </p>
    399  1.1.1.13  christos 
    400  1.1.1.13  christos <hr>
    401  1.1.1.15  christos <span id="ntpdc-config"></span><div class="header">
    402  1.1.1.13  christos <p>
    403  1.1.1.15  christos Next: <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>
    404       1.1  christos </div>
    405  1.1.1.15  christos <span id="presetting_002fconfiguring-ntpdc"></span><h4 class="subsection">1.1.11 presetting/configuring ntpdc</h4>
    406       1.1  christos 
    407       1.1  christos <p>Any option that is not marked as <i>not presettable</i> may be preset by
    408  1.1.1.13  christos loading 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
    409  1.1.1.13  christos the options listed above in upper case and segmented with underscores.
    410       1.1  christos The <code>NTPDC</code> variable will be tokenized and parsed like
    411       1.1  christos the command line.  The remaining variables are tested for existence and their
    412       1.1  christos values are treated like option arguments.
    413  1.1.1.13  christos </p>
    414       1.1  christos 
    415  1.1.1.13  christos <p><code>libopts</code> will search in 2 places for configuration files:
    416  1.1.1.13  christos </p><ul>
    417  1.1.1.13  christos <li> $HOME
    418  1.1.1.13  christos </li><li> $PWD
    419  1.1.1.13  christos </li></ul>
    420  1.1.1.13  christos <p>The environment variables <code>HOME</code>, and <code>PWD</code>
    421  1.1.1.13  christos are expanded and replaced when <samp>ntpdc</samp> runs.
    422  1.1.1.13  christos For any of these that are plain files, they are simply processed.
    423  1.1.1.13  christos For any that are directories, then a file named <samp>.ntprc</samp> is searched for
    424       1.1  christos within that directory and processed.
    425  1.1.1.13  christos </p>
    426  1.1.1.13  christos <p>Configuration files may be in a wide variety of formats.
    427       1.1  christos The basic format is an option name followed by a value (argument) on the
    428       1.1  christos same line.  Values may be separated from the option name with a colon,
    429       1.1  christos equal sign or simply white space.  Values may be continued across multiple
    430       1.1  christos lines by escaping the newline with a backslash.
    431  1.1.1.13  christos </p>
    432  1.1.1.13  christos <p>Multiple programs may also share the same initialization file.
    433       1.1  christos Common options are collected at the top, followed by program specific
    434       1.1  christos segments.  The segments are separated by lines like:
    435  1.1.1.13  christos </p><div class="example">
    436  1.1.1.13  christos <pre class="example">[NTPDC]
    437  1.1.1.13  christos </pre></div>
    438  1.1.1.13  christos <p>or by
    439  1.1.1.13  christos </p><div class="example">
    440  1.1.1.13  christos <pre class="example">&lt;?program ntpdc&gt;
    441  1.1.1.13  christos </pre></div>
    442  1.1.1.13  christos <p>Do not mix these styles within one configuration file.
    443  1.1.1.13  christos </p>
    444  1.1.1.13  christos <p>Compound values and carefully constructed string values may also be
    445       1.1  christos specified using XML syntax:
    446  1.1.1.13  christos </p><div class="example">
    447  1.1.1.13  christos <pre class="example">&lt;option-name&gt;
    448  1.1.1.13  christos    &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
    449  1.1.1.13  christos &lt;/option-name&gt;
    450  1.1.1.13  christos </pre></div>
    451  1.1.1.13  christos <p>yielding an <code>option-name.sub-opt</code> string value of
    452  1.1.1.13  christos </p><div class="example">
    453  1.1.1.13  christos <pre class="example">&quot;...&lt;...&gt;...&quot;
    454  1.1.1.13  christos </pre></div>
    455  1.1.1.13  christos <p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
    456       1.1  christos hierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
    457       1.1  christos the associated name/value pair list (see: optionFindValue).
    458  1.1.1.13  christos </p>
    459  1.1.1.13  christos <p>The command line options relating to configuration and/or usage help are:
    460  1.1.1.13  christos </p>
    461  1.1.1.15  christos <span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
    462       1.1  christos 
    463       1.1  christos <p>Print the program version to standard out, optionally with licensing
    464       1.1  christos information, then exit 0.  The optional argument specifies how much licensing
    465  1.1.1.15  christos detail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
    466       1.1  christos Only the first letter of the argument is examined:
    467  1.1.1.13  christos </p>
    468  1.1.1.13  christos <dl compact="compact">
    469  1.1.1.13  christos <dt>&lsquo;<samp>version</samp>&rsquo;</dt>
    470  1.1.1.13  christos <dd><p>Only print the version.  This is the default.
    471  1.1.1.13  christos </p></dd>
    472  1.1.1.13  christos <dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
    473  1.1.1.13  christos <dd><p>Name the copyright usage licensing terms.
    474  1.1.1.13  christos </p></dd>
    475  1.1.1.13  christos <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
    476  1.1.1.13  christos <dd><p>Print the full copyright usage licensing terms.
    477  1.1.1.13  christos </p></dd>
    478       1.1  christos </dl>
    479       1.1  christos 
    480  1.1.1.13  christos <hr>
    481  1.1.1.15  christos <span id="ntpdc-exit-status"></span><div class="header">
    482  1.1.1.13  christos <p>
    483  1.1.1.13  christos Next: <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>
    484       1.1  christos </div>
    485  1.1.1.15  christos <span id="ntpdc-exit-status-1"></span><h4 class="subsection">1.1.12 ntpdc exit status</h4>
    486       1.1  christos 
    487       1.1  christos <p>One of the following exit values will be returned:
    488  1.1.1.13  christos </p><dl compact="compact">
    489  1.1.1.13  christos <dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
    490  1.1.1.13  christos <dd><p>Successful program execution.
    491  1.1.1.13  christos </p></dd>
    492  1.1.1.13  christos <dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
    493  1.1.1.13  christos <dd><p>The operation failed or the command syntax was not valid.
    494  1.1.1.13  christos </p></dd>
    495  1.1.1.13  christos <dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
    496  1.1.1.13  christos <dd><p>A specified configuration file could not be loaded.
    497  1.1.1.13  christos </p></dd>
    498  1.1.1.13  christos <dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
    499  1.1.1.13  christos <dd><p>libopts had an internal operational error.  Please report
    500  1.1.1.13  christos it to autogen-users (a] lists.sourceforge.net.  Thank you.
    501  1.1.1.13  christos </p></dd>
    502       1.1  christos </dl>
    503  1.1.1.13  christos <hr>
    504  1.1.1.15  christos <span id="ntpdc-Usage"></span><div class="header">
    505  1.1.1.13  christos <p>
    506  1.1.1.13  christos Next: <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>
    507  1.1.1.13  christos </div>
    508  1.1.1.15  christos <span id="ntpdc-Usage-1"></span><h4 class="subsection">1.1.13 ntpdc Usage</h4>
    509  1.1.1.13  christos <hr>
    510  1.1.1.15  christos <span id="ntpdc-See-Also"></span><div class="header">
    511  1.1.1.13  christos <p>
    512  1.1.1.13  christos Next: <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>
    513  1.1.1.13  christos </div>
    514  1.1.1.15  christos <span id="ntpdc-See-Also-1"></span><h4 class="subsection">1.1.14 ntpdc See Also</h4>
    515  1.1.1.13  christos <hr>
    516  1.1.1.15  christos <span id="ntpdc-Authors"></span><div class="header">
    517  1.1.1.13  christos <p>
    518  1.1.1.13  christos Next: <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>
    519  1.1.1.13  christos </div>
    520  1.1.1.15  christos <span id="ntpdc-Authors-1"></span><h4 class="subsection">1.1.15 ntpdc Authors</h4>
    521  1.1.1.13  christos <hr>
    522  1.1.1.15  christos <span id="ntpdc-Bugs"></span><div class="header">
    523  1.1.1.13  christos <p>
    524  1.1.1.13  christos Previous: <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>
    525       1.1  christos </div>
    526  1.1.1.15  christos <span id="ntpdc-Bugs-1"></span><h4 class="subsection">1.1.16 ntpdc Bugs</h4>
    527       1.1  christos 
    528  1.1.1.13  christos <hr>
    529  1.1.1.15  christos <span id="Usage"></span><div class="header">
    530  1.1.1.13  christos <p>
    531  1.1.1.13  christos Previous: <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>
    532       1.1  christos </div>
    533  1.1.1.15  christos <span id="Usage-1"></span><h3 class="section">1.2 Usage</h3>
    534       1.1  christos 
    535       1.1  christos <p>The simplest use of this program is as an unprivileged command to
    536  1.1.1.13  christos check the current time, offset, and error in the local clock.
    537       1.1  christos For example:
    538  1.1.1.13  christos </p>
    539  1.1.1.13  christos <div class="example">
    540  1.1.1.13  christos <pre class="example">ntpdc ntpserver.somewhere
    541  1.1.1.13  christos </pre></div>
    542       1.1  christos 
    543  1.1.1.13  christos <p>With suitable privilege, it can be run as a command or in a
    544       1.1  christos <code>cron</code> job to reset the local clock from a reliable server, like
    545  1.1.1.13  christos the <code>ntpdate</code> and <code>rdate</code> commands.
    546       1.1  christos For example:
    547  1.1.1.13  christos </p>
    548  1.1.1.13  christos <div class="example">
    549  1.1.1.13  christos <pre class="example">ntpdc -a ntpserver.somewhere
    550  1.1.1.13  christos </pre></div>
    551  1.1.1.13  christos <hr>
    552  1.1.1.13  christos 
    553       1.1  christos 
    554       1.1  christos 
    555  1.1.1.13  christos </body>
    556  1.1.1.13  christos </html>
    557