xref: /freebsd/contrib/ntp/ntpdc/ntpdc.html (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2052d159aSCy Schubert<html>
3a466cc55SCy Schubert<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6052d159aSCy Schubert<title>ntpdc: NTPD Control User&rsquo;s Manual</title>
7052d159aSCy Schubert
8052d159aSCy Schubert<meta name="description" content="ntpdc: NTPD Control User&rsquo;s Manual">
9052d159aSCy Schubert<meta name="keywords" content="ntpdc: NTPD Control User&rsquo;s Manual">
10052d159aSCy Schubert<meta name="resource-type" content="document">
11052d159aSCy Schubert<meta name="distribution" content="global">
12052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15052d159aSCy Schubert<style type="text/css">
16052d159aSCy Schubert<!--
17052d159aSCy Schuberta.summary-letter {text-decoration: none}
18052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19052d159aSCy Schubertdiv.display {margin-left: 3.2em}
20052d159aSCy Schubertdiv.example {margin-left: 3.2em}
21052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
22052d159aSCy Schubertkbd {font-style: oblique}
232b15cb3dSCy Schubertpre.display {font-family: inherit}
242b15cb3dSCy Schubertpre.format {font-family: inherit}
25052d159aSCy Schubertpre.menu-comment {font-family: serif}
26052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
27052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
28052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
29052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
30052d159aSCy Schubertul.no-bullet {list-style: none}
31052d159aSCy Schubert-->
32052d159aSCy Schubert</style>
33052d159aSCy Schubert
34052d159aSCy Schubert
352b15cb3dSCy Schubert</head>
36052d159aSCy Schubert
37052d159aSCy Schubert<body lang="en">
38052d159aSCy Schubert<h1 class="settitle" align="center">ntpdc: NTPD Control User&rsquo;s Manual</h1>
39052d159aSCy Schubert
40052d159aSCy Schubert
41052d159aSCy Schubert
42052d159aSCy Schubert
43052d159aSCy Schubert
44a466cc55SCy Schubert<span id="Top"></span><div class="header">
45052d159aSCy Schubert<p>
46052d159aSCy SchubertNext: <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>
472b15cb3dSCy Schubert</div>
48a466cc55SCy Schubert<span id="ntpdc_003a-NTPD-Control-User-Manual"></span><h1 class="top">ntpdc: NTPD Control User Manual</h1>
492b15cb3dSCy Schubert
50052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>ntpdc</code> program,
512b15cb3dSCy Schubertthat can be used to query a Network Time Protocol (NTP) server and
522b15cb3dSCy Schubertdisplay the time offset of the system clock relative to the server
532b15cb3dSCy Schubertclock.  Run as root, it can correct the system clock to this offset as
542b15cb3dSCy Schubertwell.  It can be run as an interactive command or from a cron job.
55052d159aSCy Schubert</p>
56*f5f40dd6SCy Schubert<p>This document applies to version 4.2.8p18 of <code>ntpdc</code>.
57052d159aSCy Schubert</p>
582b15cb3dSCy Schubert<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
592b15cb3dSCy SchubertIETF specification.
60052d159aSCy Schubert</p>
61a466cc55SCy Schubert<span id="SEC_Overview"></span>
62052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
632b15cb3dSCy Schubert
642b15cb3dSCy Schubert<div class="shortcontents">
65052d159aSCy Schubert<ul class="no-bullet">
66a466cc55SCy Schubert<li><a id="stoc-Description" href="#toc-Description">1 Description</a></li>
672b15cb3dSCy Schubert</ul>
682b15cb3dSCy Schubert</div>
692b15cb3dSCy Schubert
702b15cb3dSCy Schubert
71052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
72a466cc55SCy Schubert<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
73052d159aSCy Schubert</td></tr>
74a466cc55SCy Schubert<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
75052d159aSCy Schubert</td></tr>
76a466cc55SCy Schubert<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
77052d159aSCy Schubert</td></tr>
78052d159aSCy Schubert</table>
79052d159aSCy Schubert
80052d159aSCy Schubert<hr>
81a466cc55SCy Schubert<span id="ntpdc-Description"></span><div class="header">
82052d159aSCy Schubert<p>
83052d159aSCy SchubertNext: <a href="#ntpdc-Invocation" accesskey="n" rel="next">ntpdc Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
842b15cb3dSCy Schubert</div>
85a466cc55SCy Schubert<span id="Description"></span><h2 class="chapter">1 Description</h2>
862b15cb3dSCy Schubert
872b15cb3dSCy Schubert<p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
882b15cb3dSCy Schubertstandard output in the format:
89052d159aSCy Schubert</p>
90052d159aSCy Schubert<div class="example">
912b15cb3dSCy Schubert<pre class="example">1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
92052d159aSCy Schubert</pre></div>
93052d159aSCy Schubert
942b15cb3dSCy Schubert<p>where
952b15cb3dSCy SchubertYYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
962b15cb3dSCy Schubert(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
972b15cb3dSCy Schubertand
982b15cb3dSCy Schubertthe +4.567 +/- 0.089 secs indicates the time offset and
992b15cb3dSCy Schuberterror bound of the system clock relative to the server clock.
100052d159aSCy Schubert</p>
101052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
102a466cc55SCy Schubert<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">
103052d159aSCy Schubert</td></tr>
104a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
105052d159aSCy Schubert</td></tr>
106052d159aSCy Schubert</table>
1072b15cb3dSCy Schubert
108052d159aSCy Schubert<hr>
109a466cc55SCy Schubert<span id="ntpdc-Invocation"></span><div class="header">
110052d159aSCy Schubert<p>
111052d159aSCy SchubertNext: <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>
1122b15cb3dSCy Schubert</div>
113a466cc55SCy Schubert<span id="Invoking-ntpdc"></span><h3 class="section">1.1 Invoking ntpdc</h3>
114a466cc55SCy Schubert<span id="index-ntpdc"></span>
115a466cc55SCy Schubert<span id="index-vendor_002dspecific-NTPD-control-program"></span>
1162b15cb3dSCy Schubert
1172b15cb3dSCy Schubert
1182b15cb3dSCy Schubert
1192b15cb3dSCy Schubert<p><code>ntpdc</code>
1202b15cb3dSCy Schubertis deprecated.
1212b15cb3dSCy SchubertPlease use
1222b15cb3dSCy Schubert<code>ntpq(1ntpqmdoc)</code> instead - it can do everything
1232b15cb3dSCy Schubert<code>ntpdc</code>
1242b15cb3dSCy Schubertused to do, and it does so using a much more sane interface.
125052d159aSCy Schubert</p>
1262b15cb3dSCy Schubert<p><code>ntpdc</code>
1272b15cb3dSCy Schubertis a utility program used to query
1282b15cb3dSCy Schubert<code>ntpd(1ntpdmdoc)</code>
1292b15cb3dSCy Schubertabout its
1302b15cb3dSCy Schubertcurrent state and to request changes in that state.
1312b15cb3dSCy SchubertIt uses NTP mode 7 control message formats described in the source code.
1322b15cb3dSCy SchubertThe program may
1332b15cb3dSCy Schubertbe run either in interactive mode or controlled using command line
1342b15cb3dSCy Schubertarguments.
1352b15cb3dSCy SchubertExtensive state and statistics information is available
1362b15cb3dSCy Schubertthrough the
1372b15cb3dSCy Schubert<code>ntpdc</code>
1382b15cb3dSCy Schubertinterface.
1392b15cb3dSCy SchubertIn addition, nearly all the
1402b15cb3dSCy Schubertconfiguration options which can be specified at startup using
141052d159aSCy Schubertntpd&rsquo;s configuration file may also be specified at run time using
1422b15cb3dSCy Schubert<code>ntpdc</code>
143052d159aSCy Schubert</p>
1442b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1452b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
1462b15cb3dSCy SchubertThis software is released under the NTP license, &lt;http://ntp.org/license&gt;.
147052d159aSCy Schubert</p>
148052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
149a466cc55SCy Schubert<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>)
150052d159aSCy Schubert</td></tr>
151a466cc55SCy Schubert<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)
152052d159aSCy Schubert</td></tr>
153a466cc55SCy Schubert<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)
154052d159aSCy Schubert</td></tr>
155a466cc55SCy Schubert<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)
156052d159aSCy Schubert</td></tr>
157a466cc55SCy Schubert<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)
158052d159aSCy Schubert</td></tr>
159a466cc55SCy Schubert<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)
160052d159aSCy Schubert</td></tr>
161a466cc55SCy Schubert<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)
162052d159aSCy Schubert</td></tr>
163a466cc55SCy Schubert<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)
164052d159aSCy Schubert</td></tr>
165a466cc55SCy Schubert<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)
166052d159aSCy Schubert</td></tr>
167a466cc55SCy Schubert<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)
168052d159aSCy Schubert</td></tr>
169a466cc55SCy Schubert<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
170052d159aSCy Schubert</td></tr>
171a466cc55SCy Schubert<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
172052d159aSCy Schubert</td></tr>
173a466cc55SCy Schubert<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
174052d159aSCy Schubert</td></tr>
175a466cc55SCy Schubert<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
176052d159aSCy Schubert</td></tr>
177a466cc55SCy Schubert<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
178a466cc55SCy Schubert</td></tr>
179a466cc55SCy Schubert<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
180052d159aSCy Schubert</td></tr>
181052d159aSCy Schubert</table>
1822b15cb3dSCy Schubert
183052d159aSCy Schubert<hr>
184a466cc55SCy Schubert<span id="ntpdc-usage"></span><div class="header">
185052d159aSCy Schubert<p>
186052d159aSCy SchubertNext: <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>
1872b15cb3dSCy Schubert</div>
188a466cc55SCy Schubert<span id="ntpdc-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1.1 ntpdc help/usage (<samp>--help</samp>)</h4>
189a466cc55SCy Schubert<span id="index-ntpdc-help"></span>
1902b15cb3dSCy Schubert
191052d159aSCy Schubert<p>This is the automatically generated usage text for ntpdc.
192052d159aSCy Schubert</p>
1932b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
194052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1952b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1962b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1972b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
198052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1992b15cb3dSCy Schubertwith a status code of 0.
200052d159aSCy Schubert</p>
201052d159aSCy Schubert<div class="example">
202*f5f40dd6SCy Schubert<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18
2032b15cb3dSCy SchubertUsage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
2042b15cb3dSCy Schubert  Flg Arg Option-Name    Description
2052b15cb3dSCy Schubert   -4 no  ipv4           Force IPv4 DNS name resolution
2062b15cb3dSCy Schubert                                - prohibits the option 'ipv6'
2072b15cb3dSCy Schubert   -6 no  ipv6           Force IPv6 DNS name resolution
2082b15cb3dSCy Schubert                                - prohibits the option 'ipv4'
2092b15cb3dSCy Schubert   -c Str command        run a command and exit
2102b15cb3dSCy Schubert                                - may appear multiple times
2112b15cb3dSCy Schubert   -d no  debug-level    Increase debug verbosity level
2122b15cb3dSCy Schubert                                - may appear multiple times
2132b15cb3dSCy Schubert   -D Num set-debug-level Set the debug verbosity level
2142b15cb3dSCy Schubert                                - may appear multiple times
2152b15cb3dSCy Schubert   -i no  interactive    Force ntpq to operate in interactive mode
2162b15cb3dSCy Schubert                                - prohibits these options:
2172b15cb3dSCy Schubert                                command
2182b15cb3dSCy Schubert                                listpeers
2192b15cb3dSCy Schubert                                peers
2202b15cb3dSCy Schubert                                showpeers
2212b15cb3dSCy Schubert   -l no  listpeers      Print a list of the peers
2222b15cb3dSCy Schubert                                - prohibits the option 'command'
2232b15cb3dSCy Schubert   -n no  numeric        numeric host addresses
2242b15cb3dSCy Schubert   -p no  peers          Print a list of the peers
2252b15cb3dSCy Schubert                                - prohibits the option 'command'
2262b15cb3dSCy Schubert   -s no  showpeers      Show a list of the peers
2272b15cb3dSCy Schubert                                - prohibits the option 'command'
228a466cc55SCy Schubert   -u no  unconnected    Use unconnected UDP to communicate with ntpd (default on Windows)
2292b15cb3dSCy Schubert      opt version        output version information and exit
2302b15cb3dSCy Schubert   -? no  help           display extended usage information and exit
2312b15cb3dSCy Schubert   -! no  more-help      extended usage information passed thru pager
2322b15cb3dSCy Schubert   -&gt; opt save-opts      save the option state to a config file
2332b15cb3dSCy Schubert   -&lt; Str load-opts      load options from a config file
2342b15cb3dSCy Schubert                                - disabled as '--no-load-opts'
2352b15cb3dSCy Schubert                                - may appear multiple times
2362b15cb3dSCy Schubert
2372b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
2382b15cb3dSCy Schuberthyphen and the flag character.
2392b15cb3dSCy Schubert
2402b15cb3dSCy Schubert
2412b15cb3dSCy SchubertThe following option preset mechanisms are supported:
2422b15cb3dSCy Schubert - reading file $HOME/.ntprc
2432b15cb3dSCy Schubert - reading file ./.ntprc
2442b15cb3dSCy Schubert - examining environment variables named NTPDC_*
2452b15cb3dSCy Schubert
246a466cc55SCy SchubertPlease send bug reports to:  &lt;https://bugs.ntp.org, bugs@ntp.org&gt;
247052d159aSCy Schubert</pre></div>
248052d159aSCy Schubert
249052d159aSCy Schubert<hr>
250a466cc55SCy Schubert<span id="ntpdc-ipv4"></span><div class="header">
251052d159aSCy Schubert<p>
252052d159aSCy SchubertNext: <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>
2532b15cb3dSCy Schubert</div>
254a466cc55SCy Schubert<span id="ipv4-option-_0028_002d4_0029"></span><h4 class="subsection">1.1.2 ipv4 option (-4)</h4>
255a466cc55SCy Schubert<span id="index-ntpdc_002dipv4"></span>
2562b15cb3dSCy Schubert
257052d159aSCy Schubert<p>This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
258052d159aSCy Schubert</p>
259052d159aSCy Schubert<p>This option has some usage constraints.  It:
260052d159aSCy Schubert</p><ul>
2612b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
2622b15cb3dSCy Schubertipv6.
263052d159aSCy Schubert</li></ul>
2642b15cb3dSCy Schubert
2652b15cb3dSCy Schubert<p>Force DNS resolution of following host names on the command line
2662b15cb3dSCy Schubertto the IPv4 namespace.
267052d159aSCy Schubert</p><hr>
268a466cc55SCy Schubert<span id="ntpdc-ipv6"></span><div class="header">
269052d159aSCy Schubert<p>
270052d159aSCy SchubertNext: <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>
2712b15cb3dSCy Schubert</div>
272a466cc55SCy Schubert<span id="ipv6-option-_0028_002d6_0029"></span><h4 class="subsection">1.1.3 ipv6 option (-6)</h4>
273a466cc55SCy Schubert<span id="index-ntpdc_002dipv6"></span>
2742b15cb3dSCy Schubert
275052d159aSCy Schubert<p>This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
276052d159aSCy Schubert</p>
277052d159aSCy Schubert<p>This option has some usage constraints.  It:
278052d159aSCy Schubert</p><ul>
2792b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
2802b15cb3dSCy Schubertipv4.
281052d159aSCy Schubert</li></ul>
2822b15cb3dSCy Schubert
2832b15cb3dSCy Schubert<p>Force DNS resolution of following host names on the command line
2842b15cb3dSCy Schubertto the IPv6 namespace.
285052d159aSCy Schubert</p><hr>
286a466cc55SCy Schubert<span id="ntpdc-command"></span><div class="header">
287052d159aSCy Schubert<p>
288052d159aSCy SchubertNext: <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>
2892b15cb3dSCy Schubert</div>
290a466cc55SCy Schubert<span id="command-option-_0028_002dc_0029"></span><h4 class="subsection">1.1.4 command option (-c)</h4>
291a466cc55SCy Schubert<span id="index-ntpdc_002dcommand"></span>
2922b15cb3dSCy Schubert
293052d159aSCy Schubert<p>This is the &ldquo;run a command and exit&rdquo; option.
294052d159aSCy SchubertThis option takes a string argument <samp>cmd</samp>.
295052d159aSCy Schubert</p>
296052d159aSCy Schubert<p>This option has some usage constraints.  It:
297052d159aSCy Schubert</p><ul>
2982b15cb3dSCy Schubert<li> may appear an unlimited number of times.
299052d159aSCy Schubert</li></ul>
3002b15cb3dSCy Schubert
3012b15cb3dSCy Schubert<p>The following argument is interpreted as an interactive format command
3022b15cb3dSCy Schubertand is added to the list of commands to be executed on the specified
3032b15cb3dSCy Schuberthost(s).
304052d159aSCy Schubert</p><hr>
305a466cc55SCy Schubert<span id="ntpdc-interactive"></span><div class="header">
306052d159aSCy Schubert<p>
307052d159aSCy SchubertNext: <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>
3082b15cb3dSCy Schubert</div>
309a466cc55SCy Schubert<span id="interactive-option-_0028_002di_0029"></span><h4 class="subsection">1.1.5 interactive option (-i)</h4>
310a466cc55SCy Schubert<span id="index-ntpdc_002dinteractive"></span>
3112b15cb3dSCy Schubert
312052d159aSCy Schubert<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
313052d159aSCy Schubert</p>
314052d159aSCy Schubert<p>This option has some usage constraints.  It:
315052d159aSCy Schubert</p><ul>
3162b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
3172b15cb3dSCy Schubertcommand, listpeers, peers, showpeers.
318052d159aSCy Schubert</li></ul>
3192b15cb3dSCy Schubert
3202b15cb3dSCy Schubert<p>Force ntpq to operate in interactive mode.  Prompts will be written
3212b15cb3dSCy Schubertto the standard output and commands read from the standard input.
322052d159aSCy Schubert</p><hr>
323a466cc55SCy Schubert<span id="ntpdc-listpeers"></span><div class="header">
324052d159aSCy Schubert<p>
325052d159aSCy SchubertNext: <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>
3262b15cb3dSCy Schubert</div>
327a466cc55SCy Schubert<span id="listpeers-option-_0028_002dl_0029"></span><h4 class="subsection">1.1.6 listpeers option (-l)</h4>
328a466cc55SCy Schubert<span id="index-ntpdc_002dlistpeers"></span>
3292b15cb3dSCy Schubert
330052d159aSCy Schubert<p>This is the &ldquo;print a list of the peers&rdquo; option.
331052d159aSCy Schubert</p>
332052d159aSCy Schubert<p>This option has some usage constraints.  It:
333052d159aSCy Schubert</p><ul>
3342b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
3352b15cb3dSCy Schubertcommand.
336052d159aSCy Schubert</li></ul>
3372b15cb3dSCy Schubert
3382b15cb3dSCy Schubert<p>Print a list of the peers known to the server as well as a summary of
339052d159aSCy Schuberttheir state. This is equivalent to the &rsquo;listpeers&rsquo; interactive command.
340052d159aSCy Schubert</p><hr>
341a466cc55SCy Schubert<span id="ntpdc-numeric"></span><div class="header">
342052d159aSCy Schubert<p>
343052d159aSCy SchubertNext: <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>
3442b15cb3dSCy Schubert</div>
345a466cc55SCy Schubert<span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.7 numeric option (-n)</h4>
346a466cc55SCy Schubert<span id="index-ntpdc_002dnumeric"></span>
3472b15cb3dSCy Schubert
348052d159aSCy Schubert<p>This is the &ldquo;numeric host addresses&rdquo; option.
3492b15cb3dSCy SchubertOutput all host addresses in dotted-quad numeric format rather than
3502b15cb3dSCy Schubertconverting to the canonical host names.
351052d159aSCy Schubert</p><hr>
352a466cc55SCy Schubert<span id="ntpdc-peers"></span><div class="header">
353052d159aSCy Schubert<p>
354052d159aSCy SchubertNext: <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>
3552b15cb3dSCy Schubert</div>
356a466cc55SCy Schubert<span id="peers-option-_0028_002dp_0029"></span><h4 class="subsection">1.1.8 peers option (-p)</h4>
357a466cc55SCy Schubert<span id="index-ntpdc_002dpeers"></span>
3582b15cb3dSCy Schubert
359052d159aSCy Schubert<p>This is the &ldquo;print a list of the peers&rdquo; option.
360052d159aSCy Schubert</p>
361052d159aSCy Schubert<p>This option has some usage constraints.  It:
362052d159aSCy Schubert</p><ul>
3632b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
3642b15cb3dSCy Schubertcommand.
365052d159aSCy Schubert</li></ul>
3662b15cb3dSCy Schubert
3672b15cb3dSCy Schubert<p>Print a list of the peers known to the server as well as a summary
368052d159aSCy Schubertof their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
369052d159aSCy Schubert</p><hr>
370a466cc55SCy Schubert<span id="ntpdc-showpeers"></span><div class="header">
371052d159aSCy Schubert<p>
372a466cc55SCy SchubertNext: <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>
3732b15cb3dSCy Schubert</div>
374a466cc55SCy Schubert<span id="showpeers-option-_0028_002ds_0029"></span><h4 class="subsection">1.1.9 showpeers option (-s)</h4>
375a466cc55SCy Schubert<span id="index-ntpdc_002dshowpeers"></span>
3762b15cb3dSCy Schubert
377052d159aSCy Schubert<p>This is the &ldquo;show a list of the peers&rdquo; option.
378052d159aSCy Schubert</p>
379052d159aSCy Schubert<p>This option has some usage constraints.  It:
380052d159aSCy Schubert</p><ul>
3812b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
3822b15cb3dSCy Schubertcommand.
383052d159aSCy Schubert</li></ul>
3842b15cb3dSCy Schubert
3852b15cb3dSCy Schubert<p>Print a list of the peers known to the server as well as a summary
386052d159aSCy Schubertof their state. This is equivalent to the &rsquo;dmpeers&rsquo; interactive command.
387a466cc55SCy Schubert</p><hr>
388a466cc55SCy Schubert<span id="ntpdc-unconnected"></span><div class="header">
389a466cc55SCy Schubert<p>
390a466cc55SCy SchubertNext: <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>
391a466cc55SCy Schubert</div>
392a466cc55SCy Schubert<span id="unconnected-option-_0028_002du_0029"></span><h4 class="subsection">1.1.10 unconnected option (-u)</h4>
393a466cc55SCy Schubert<span id="index-ntpdc_002dunconnected"></span>
394a466cc55SCy Schubert
395a466cc55SCy Schubert<p>This is the &ldquo;use unconnected udp to communicate with ntpd (default on windows)&rdquo; option.
396a466cc55SCy SchubertOpen an unconnected UDP association to ntpd (the default
397a466cc55SCy Schuberton Windows).
398052d159aSCy Schubert</p>
3992b15cb3dSCy Schubert
400052d159aSCy Schubert<hr>
401a466cc55SCy Schubert<span id="ntpdc-config"></span><div class="header">
402052d159aSCy Schubert<p>
403a466cc55SCy SchubertNext: <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>
4042b15cb3dSCy Schubert</div>
405a466cc55SCy Schubert<span id="presetting_002fconfiguring-ntpdc"></span><h4 class="subsection">1.1.11 presetting/configuring ntpdc</h4>
4062b15cb3dSCy Schubert
4072b15cb3dSCy Schubert<p>Any option that is not marked as <i>not presettable</i> may be preset by
408052d159aSCy Schubertloading 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
4092b15cb3dSCy Schubertthe options listed above in upper case and segmented with underscores.
4102b15cb3dSCy SchubertThe <code>NTPDC</code> variable will be tokenized and parsed like
4112b15cb3dSCy Schubertthe command line.  The remaining variables are tested for existence and their
4122b15cb3dSCy Schubertvalues are treated like option arguments.
413052d159aSCy Schubert</p>
4142b15cb3dSCy Schubert
415052d159aSCy Schubert<p><code>libopts</code> will search in 2 places for configuration files:
416052d159aSCy Schubert</p><ul>
4172b15cb3dSCy Schubert<li> $HOME
418052d159aSCy Schubert</li><li> $PWD
419052d159aSCy Schubert</li></ul>
420052d159aSCy Schubert<p>The environment variables <code>HOME</code>, and <code>PWD</code>
421052d159aSCy Schubertare expanded and replaced when <samp>ntpdc</samp> runs.
4222b15cb3dSCy SchubertFor any of these that are plain files, they are simply processed.
423052d159aSCy SchubertFor any that are directories, then a file named <samp>.ntprc</samp> is searched for
4242b15cb3dSCy Schubertwithin that directory and processed.
425052d159aSCy Schubert</p>
4262b15cb3dSCy Schubert<p>Configuration files may be in a wide variety of formats.
4272b15cb3dSCy SchubertThe basic format is an option name followed by a value (argument) on the
4282b15cb3dSCy Schubertsame line.  Values may be separated from the option name with a colon,
4292b15cb3dSCy Schubertequal sign or simply white space.  Values may be continued across multiple
4302b15cb3dSCy Schubertlines by escaping the newline with a backslash.
431052d159aSCy Schubert</p>
4322b15cb3dSCy Schubert<p>Multiple programs may also share the same initialization file.
4332b15cb3dSCy SchubertCommon options are collected at the top, followed by program specific
4342b15cb3dSCy Schubertsegments.  The segments are separated by lines like:
435052d159aSCy Schubert</p><div class="example">
4362b15cb3dSCy Schubert<pre class="example">[NTPDC]
437052d159aSCy Schubert</pre></div>
438052d159aSCy Schubert<p>or by
439052d159aSCy Schubert</p><div class="example">
4402b15cb3dSCy Schubert<pre class="example">&lt;?program ntpdc&gt;
441052d159aSCy Schubert</pre></div>
442052d159aSCy Schubert<p>Do not mix these styles within one configuration file.
443052d159aSCy Schubert</p>
4442b15cb3dSCy Schubert<p>Compound values and carefully constructed string values may also be
4452b15cb3dSCy Schubertspecified using XML syntax:
446052d159aSCy Schubert</p><div class="example">
4472b15cb3dSCy Schubert<pre class="example">&lt;option-name&gt;
4482b15cb3dSCy Schubert   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
4492b15cb3dSCy Schubert&lt;/option-name&gt;
450052d159aSCy Schubert</pre></div>
451052d159aSCy Schubert<p>yielding an <code>option-name.sub-opt</code> string value of
452052d159aSCy Schubert</p><div class="example">
453052d159aSCy Schubert<pre class="example">&quot;...&lt;...&gt;...&quot;
454052d159aSCy Schubert</pre></div>
4552b15cb3dSCy Schubert<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
4562b15cb3dSCy Schuberthierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
4572b15cb3dSCy Schubertthe associated name/value pair list (see: optionFindValue).
458052d159aSCy Schubert</p>
4592b15cb3dSCy Schubert<p>The command line options relating to configuration and/or usage help are:
460052d159aSCy Schubert</p>
461a466cc55SCy Schubert<span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
4622b15cb3dSCy Schubert
4632b15cb3dSCy Schubert<p>Print the program version to standard out, optionally with licensing
4642b15cb3dSCy Schubertinformation, then exit 0.  The optional argument specifies how much licensing
465a466cc55SCy Schubertdetail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
4662b15cb3dSCy SchubertOnly the first letter of the argument is examined:
467052d159aSCy Schubert</p>
468052d159aSCy Schubert<dl compact="compact">
469052d159aSCy Schubert<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
470052d159aSCy Schubert<dd><p>Only print the version.  This is the default.
471052d159aSCy Schubert</p></dd>
472052d159aSCy Schubert<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
473052d159aSCy Schubert<dd><p>Name the copyright usage licensing terms.
474052d159aSCy Schubert</p></dd>
475052d159aSCy Schubert<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
476052d159aSCy Schubert<dd><p>Print the full copyright usage licensing terms.
477052d159aSCy Schubert</p></dd>
4782b15cb3dSCy Schubert</dl>
4792b15cb3dSCy Schubert
480052d159aSCy Schubert<hr>
481a466cc55SCy Schubert<span id="ntpdc-exit-status"></span><div class="header">
482052d159aSCy Schubert<p>
483052d159aSCy SchubertNext: <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>
4842b15cb3dSCy Schubert</div>
485a466cc55SCy Schubert<span id="ntpdc-exit-status-1"></span><h4 class="subsection">1.1.12 ntpdc exit status</h4>
4862b15cb3dSCy Schubert
4872b15cb3dSCy Schubert<p>One of the following exit values will be returned:
488052d159aSCy Schubert</p><dl compact="compact">
489052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
490052d159aSCy Schubert<dd><p>Successful program execution.
491052d159aSCy Schubert</p></dd>
492052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
493052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
494052d159aSCy Schubert</p></dd>
495052d159aSCy Schubert<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
496052d159aSCy Schubert<dd><p>A specified configuration file could not be loaded.
497052d159aSCy Schubert</p></dd>
498052d159aSCy Schubert<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
499052d159aSCy Schubert<dd><p>libopts had an internal operational error.  Please report
5002b15cb3dSCy Schubertit to autogen-users@lists.sourceforge.net.  Thank you.
501052d159aSCy Schubert</p></dd>
5022b15cb3dSCy Schubert</dl>
503052d159aSCy Schubert<hr>
504a466cc55SCy Schubert<span id="ntpdc-Usage"></span><div class="header">
505052d159aSCy Schubert<p>
506052d159aSCy SchubertNext: <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>
5072b15cb3dSCy Schubert</div>
508a466cc55SCy Schubert<span id="ntpdc-Usage-1"></span><h4 class="subsection">1.1.13 ntpdc Usage</h4>
509052d159aSCy Schubert<hr>
510a466cc55SCy Schubert<span id="ntpdc-See-Also"></span><div class="header">
511052d159aSCy Schubert<p>
512052d159aSCy SchubertNext: <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>
5132b15cb3dSCy Schubert</div>
514a466cc55SCy Schubert<span id="ntpdc-See-Also-1"></span><h4 class="subsection">1.1.14 ntpdc See Also</h4>
515052d159aSCy Schubert<hr>
516a466cc55SCy Schubert<span id="ntpdc-Authors"></span><div class="header">
517052d159aSCy Schubert<p>
518052d159aSCy SchubertNext: <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>
5192b15cb3dSCy Schubert</div>
520a466cc55SCy Schubert<span id="ntpdc-Authors-1"></span><h4 class="subsection">1.1.15 ntpdc Authors</h4>
521052d159aSCy Schubert<hr>
522a466cc55SCy Schubert<span id="ntpdc-Bugs"></span><div class="header">
523052d159aSCy Schubert<p>
524052d159aSCy SchubertPrevious: <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>
5252b15cb3dSCy Schubert</div>
526a466cc55SCy Schubert<span id="ntpdc-Bugs-1"></span><h4 class="subsection">1.1.16 ntpdc Bugs</h4>
5272b15cb3dSCy Schubert
528052d159aSCy Schubert<hr>
529a466cc55SCy Schubert<span id="Usage"></span><div class="header">
530052d159aSCy Schubert<p>
531052d159aSCy SchubertPrevious: <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>
5322b15cb3dSCy Schubert</div>
533a466cc55SCy Schubert<span id="Usage-1"></span><h3 class="section">1.2 Usage</h3>
5342b15cb3dSCy Schubert
5352b15cb3dSCy Schubert<p>The simplest use of this program is as an unprivileged command to
5362b15cb3dSCy Schubertcheck the current time, offset, and error in the local clock.
5372b15cb3dSCy SchubertFor example:
538052d159aSCy Schubert</p>
539052d159aSCy Schubert<div class="example">
5402b15cb3dSCy Schubert<pre class="example">ntpdc ntpserver.somewhere
541052d159aSCy Schubert</pre></div>
542052d159aSCy Schubert
5432b15cb3dSCy Schubert<p>With suitable privilege, it can be run as a command or in a
5442b15cb3dSCy Schubert<code>cron</code> job to reset the local clock from a reliable server, like
5452b15cb3dSCy Schubertthe <code>ntpdate</code> and <code>rdate</code> commands.
5462b15cb3dSCy SchubertFor example:
547052d159aSCy Schubert</p>
548052d159aSCy Schubert<div class="example">
5492b15cb3dSCy Schubert<pre class="example">ntpdc -a ntpserver.somewhere
550052d159aSCy Schubert</pre></div>
551052d159aSCy Schubert<hr>
5522b15cb3dSCy Schubert
553052d159aSCy Schubert
554052d159aSCy Schubert
555052d159aSCy Schubert</body>
556052d159aSCy Schubert</html>
557