xref: /freebsd/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html (revision 052d159a8b83f03d7dc5eb31cd9a9b4a6fe3d9da)
1*052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2*052d159aSCy Schubert<html>
3*052d159aSCy Schubert<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5*052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6*052d159aSCy Schubert<title>calc_tickadj User&rsquo;s Manual</title>
7*052d159aSCy Schubert
8*052d159aSCy Schubert<meta name="description" content="calc_tickadj User&rsquo;s Manual">
9*052d159aSCy Schubert<meta name="keywords" content="calc_tickadj User&rsquo;s Manual">
10*052d159aSCy Schubert<meta name="resource-type" content="document">
11*052d159aSCy Schubert<meta name="distribution" content="global">
12*052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13*052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14*052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15*052d159aSCy Schubert<style type="text/css">
16*052d159aSCy Schubert<!--
17*052d159aSCy Schuberta.summary-letter {text-decoration: none}
18*052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19*052d159aSCy Schubertblockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20*052d159aSCy Schubertblockquote.smallquotation {font-size: smaller}
21*052d159aSCy Schubertdiv.display {margin-left: 3.2em}
22*052d159aSCy Schubertdiv.example {margin-left: 3.2em}
23*052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
24*052d159aSCy Schubertdiv.smalldisplay {margin-left: 3.2em}
25*052d159aSCy Schubertdiv.smallexample {margin-left: 3.2em}
26*052d159aSCy Schubertdiv.smalllisp {margin-left: 3.2em}
27*052d159aSCy Schubertkbd {font-style: oblique}
282b15cb3dSCy Schubertpre.display {font-family: inherit}
292b15cb3dSCy Schubertpre.format {font-family: inherit}
30*052d159aSCy Schubertpre.menu-comment {font-family: serif}
31*052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
322b15cb3dSCy Schubertpre.smalldisplay {font-family: inherit; font-size: smaller}
332b15cb3dSCy Schubertpre.smallexample {font-size: smaller}
34*052d159aSCy Schubertpre.smallformat {font-family: inherit; font-size: smaller}
352b15cb3dSCy Schubertpre.smalllisp {font-size: smaller}
36*052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
37*052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
38*052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
39*052d159aSCy Schubertul.no-bullet {list-style: none}
40*052d159aSCy Schubert-->
41*052d159aSCy Schubert</style>
42*052d159aSCy Schubert
43*052d159aSCy Schubert
442b15cb3dSCy Schubert</head>
45*052d159aSCy Schubert
46*052d159aSCy Schubert<body lang="en">
47*052d159aSCy Schubert<h1 class="settitle" align="center">calc_tickadj User&rsquo;s Manual</h1>
48*052d159aSCy Schubert
49*052d159aSCy Schubert
50*052d159aSCy Schubert
51*052d159aSCy Schubert
52*052d159aSCy Schubert<a name="Top"></a>
53*052d159aSCy Schubert<div class="header">
54*052d159aSCy Schubert<p>
55*052d159aSCy SchubertPrevious: <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>
562b15cb3dSCy Schubert</div>
57*052d159aSCy Schubert<a name="calc_005ftickadj-User_0027s-Manual"></a>
58*052d159aSCy Schubert<h1 class="top">calc_tickadj User&rsquo;s Manual</h1>
592b15cb3dSCy Schubert
60*052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>calc_tickadj</code> program.
61*052d159aSCy SchubertThis document applies to version 4.2.8p13 of <code>calc_tickadj</code>.
62*052d159aSCy Schubert</p>
63*052d159aSCy Schubert<a name="SEC_Overview"></a>
64*052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
652b15cb3dSCy Schubert
662b15cb3dSCy Schubert<div class="shortcontents">
67*052d159aSCy Schubert<ul class="no-bullet">
68*052d159aSCy Schubert<li><a name="stoc-Invoking-calc_005ftickadj" href="#toc-Invoking-calc_005ftickadj">1 Invoking calc_tickadj</a></li>
692b15cb3dSCy Schubert</ul>
702b15cb3dSCy Schubert</div>
712b15cb3dSCy Schubert
722b15cb3dSCy Schubert
73*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
74*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; calc_tickadj Description:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
75*052d159aSCy Schubert</td></tr>
76*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-Invocation" accesskey="2">calc_tickadj Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking calc_tickadj
77*052d159aSCy Schubert</td></tr>
78*052d159aSCy Schubert</table>
79*052d159aSCy Schubert
80*052d159aSCy Schubert<hr>
81*052d159aSCy Schubert<a name="calc_005ftickadj-Invocation"></a>
82*052d159aSCy Schubert<div class="header">
83*052d159aSCy Schubert<p>
84*052d159aSCy SchubertUp: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
852b15cb3dSCy Schubert</div>
86*052d159aSCy Schubert<a name="Invoking-calc_005ftickadj"></a>
87*052d159aSCy Schubert<h2 class="chapter">1 Invoking calc_tickadj</h2>
88*052d159aSCy Schubert<a name="index-calc_005ftickadj"></a>
89*052d159aSCy Schubert<a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e"></a>
902b15cb3dSCy Schubert
91*052d159aSCy Schubert<p>The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
922b15cb3dSCy Schuberttick value. Generally, ntpd can do better job if the drift value is the
932b15cb3dSCy Schubertsmallest possible number.
94*052d159aSCy Schubert</p>
952b15cb3dSCy Schubert<p>The example output of
96*052d159aSCy Schubert</p><div class="example">
972b15cb3dSCy Schubert<pre class="example">$ ./calc_tickadj
982b15cb3dSCy Schubert81.699 (drift)
992b15cb3dSCy Schubert9999 usec; 9999779 nsec
1002b15cb3dSCy Schubert$ cat /etc/ntp/drift
1012b15cb3dSCy Schubert-23.159
102*052d159aSCy Schubert</pre></div>
103*052d159aSCy Schubert
1042b15cb3dSCy Schubert<p>means the following. If tick on that box is 10,000, by making the value 9999
105*052d159aSCy Schubertwe&rsquo;ll shift the box from its current drift of -23.159 to a drift of 81.699, and
106*052d159aSCy Schubertin doing so we&rsquo;ll speed the clock up a little every second instead of slowing
1072b15cb3dSCy Schubertthe clock down a little.
108*052d159aSCy Schubert</p>
109*052d159aSCy Schubert<p>If &rsquo;tick&rsquo; on that box is 10,000,000 then by setting it to 9999779 the drift
1102b15cb3dSCy Schubertvalue will be somewhere around 0.0.
111*052d159aSCy Schubert</p>
1122b15cb3dSCy Schubert<p><code>calc_tickadj</code> tries to determine the the tick value by using
113*052d159aSCy Schubert<code>tickadj</code> program from ntp package. If this doesn&rsquo;t work you can specify
1142b15cb3dSCy Schubertcurrent tick manually on command line.
115*052d159aSCy Schubert</p>
1162b15cb3dSCy Schubert
1172b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1182b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
119*052d159aSCy Schubert</p>
120*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
121*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-usage" accesskey="1">calc_tickadj usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">calc_tickadj help/usage (<samp>--help</samp>)
122*052d159aSCy Schubert</td></tr>
123*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-drift_002dfile" accesskey="2">calc_tickadj drift-file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">drift-file option (-d)
124*052d159aSCy Schubert</td></tr>
125*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-tick" accesskey="3">calc_tickadj tick</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">tick option (-t)
126*052d159aSCy Schubert</td></tr>
127*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-exit-status" accesskey="4">calc_tickadj exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
128*052d159aSCy Schubert</td></tr>
129*052d159aSCy Schubert</table>
1302b15cb3dSCy Schubert
131*052d159aSCy Schubert<hr>
132*052d159aSCy Schubert<a name="calc_005ftickadj-usage"></a>
133*052d159aSCy Schubert<div class="header">
134*052d159aSCy Schubert<p>
135*052d159aSCy SchubertNext: <a href="#calc_005ftickadj-drift_002dfile" accesskey="n" rel="next">calc_tickadj drift-file</a>, Up: <a href="#calc_005ftickadj-Invocation" accesskey="u" rel="up">calc_tickadj Invocation</a> &nbsp; </p>
1362b15cb3dSCy Schubert</div>
137*052d159aSCy Schubert<a name="calc_005ftickadj-help_002fusage-_0028_002d_002dhelp_0029"></a>
138*052d159aSCy Schubert<h3 class="section">1.1 calc_tickadj help/usage (<samp>--help</samp>)</h3>
139*052d159aSCy Schubert<a name="index-calc_005ftickadj-help"></a>
1402b15cb3dSCy Schubert
141*052d159aSCy Schubert<p>This is the automatically generated usage text for calc_tickadj.
142*052d159aSCy Schubert</p>
1432b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
144*052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1452b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1462b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1472b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
148*052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1492b15cb3dSCy Schubertwith a status code of 0.
150*052d159aSCy Schubert</p>
151*052d159aSCy Schubert<div class="example">
152*052d159aSCy Schubert<pre class="example">calc_tickadj - Calculates &quot;optimal&quot; value for tick given ntp drift file. - Ver. 4.2.7p467
1532b15cb3dSCy SchubertUSAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
1542b15cb3dSCy Schubert
1552b15cb3dSCy Schubert    -d, --drift-file=str         Ntp drift file to use
1562b15cb3dSCy Schubert    -t, --tick=num               Tick value of this host
1572b15cb3dSCy Schubert    -?, --help                   Display usage information and exit
1582b15cb3dSCy Schubert        --more-help              Pass the extended usage text through a pager
1592b15cb3dSCy Schubert
1602b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
1612b15cb3dSCy Schuberthyphen and the flag character.
162*052d159aSCy Schubert</pre></div>
163*052d159aSCy Schubert
164*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
165*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-drift_002dfile" accesskey="1">calc_tickadj drift-file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
166*052d159aSCy Schubert</td></tr>
167*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-tick" accesskey="2">calc_tickadj tick</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
168*052d159aSCy Schubert</td></tr>
169*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-exit-status" accesskey="3">calc_tickadj exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
170*052d159aSCy Schubert</td></tr>
171*052d159aSCy Schubert</table>
172*052d159aSCy Schubert
173*052d159aSCy Schubert<hr>
174*052d159aSCy Schubert<a name="calc_005ftickadj-drift_002dfile"></a>
175*052d159aSCy Schubert<div class="header">
176*052d159aSCy Schubert<p>
177*052d159aSCy SchubertNext: <a href="#calc_005ftickadj-tick" accesskey="n" rel="next">calc_tickadj tick</a>, Previous: <a href="#calc_005ftickadj-usage" accesskey="p" rel="prev">calc_tickadj usage</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
1782b15cb3dSCy Schubert</div>
179*052d159aSCy Schubert<a name="drift_002dfile-option-_0028_002dd_0029"></a>
180*052d159aSCy Schubert<h4 class="subsection">1.1.1 drift-file option (-d)</h4>
181*052d159aSCy Schubert<a name="index-calc_005ftickadj_002ddrift_002dfile"></a>
1822b15cb3dSCy Schubert
183*052d159aSCy Schubert<p>This is the &ldquo;ntp drift file to use&rdquo; option.
1842b15cb3dSCy SchubertThis option takes a string argument.
1852b15cb3dSCy SchubertUse the specified drift file for calculations
186*052d159aSCy Schubert</p><hr>
187*052d159aSCy Schubert<a name="calc_005ftickadj-tick"></a>
188*052d159aSCy Schubert<div class="header">
189*052d159aSCy Schubert<p>
190*052d159aSCy SchubertNext: <a href="#calc_005ftickadj-exit-status" accesskey="n" rel="next">calc_tickadj exit status</a>, Previous: <a href="#calc_005ftickadj-drift_002dfile" accesskey="p" rel="prev">calc_tickadj drift-file</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
1912b15cb3dSCy Schubert</div>
192*052d159aSCy Schubert<a name="tick-option-_0028_002dt_0029"></a>
193*052d159aSCy Schubert<h4 class="subsection">1.1.2 tick option (-t)</h4>
194*052d159aSCy Schubert<a name="index-calc_005ftickadj_002dtick"></a>
1952b15cb3dSCy Schubert
196*052d159aSCy Schubert<p>This is the &ldquo;tick value of this host&rdquo; option.
1972b15cb3dSCy SchubertThis option takes a number argument.
1982b15cb3dSCy SchubertThe current tick which to adjustment will be calculated
199*052d159aSCy Schubert</p><hr>
200*052d159aSCy Schubert<a name="calc_005ftickadj-exit-status"></a>
201*052d159aSCy Schubert<div class="header">
202*052d159aSCy Schubert<p>
203*052d159aSCy SchubertPrevious: <a href="#calc_005ftickadj-tick" accesskey="p" rel="prev">calc_tickadj tick</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
2042b15cb3dSCy Schubert</div>
205*052d159aSCy Schubert<a name="calc_005ftickadj-exit-status-1"></a>
206*052d159aSCy Schubert<h4 class="subsection">1.1.3 calc_tickadj exit status</h4>
2072b15cb3dSCy Schubert
2082b15cb3dSCy Schubert<p>One of the following exit values will be returned:
209*052d159aSCy Schubert</p><dl compact="compact">
210*052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
211*052d159aSCy Schubert<dd><p>Successful program execution.
212*052d159aSCy Schubert</p></dd>
213*052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
214*052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
215*052d159aSCy Schubert</p></dd>
2162b15cb3dSCy Schubert</dl>
217*052d159aSCy Schubert<hr>
2182b15cb3dSCy Schubert
2192b15cb3dSCy Schubert
220*052d159aSCy Schubert
221*052d159aSCy Schubert</body>
222*052d159aSCy Schubert</html>
223