xref: /freebsd/contrib/ntp/scripts/calc_tickadj/calc_tickadj.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>calc_tickadj User&rsquo;s Manual</title>
7052d159aSCy Schubert
8052d159aSCy Schubert<meta name="description" content="calc_tickadj User&rsquo;s Manual">
9052d159aSCy Schubert<meta name="keywords" content="calc_tickadj 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">calc_tickadj User&rsquo;s Manual</h1>
39052d159aSCy Schubert
40052d159aSCy Schubert
41052d159aSCy Schubert
42052d159aSCy Schubert
43a466cc55SCy Schubert<span id="Top"></span><div class="header">
44052d159aSCy Schubert<p>
45052d159aSCy 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>
462b15cb3dSCy Schubert</div>
47a466cc55SCy Schubert<span id="calc_005ftickadj-User_0027s-Manual"></span><h1 class="top">calc_tickadj User&rsquo;s Manual</h1>
482b15cb3dSCy Schubert
49052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>calc_tickadj</code> program.
50*f5f40dd6SCy SchubertThis document applies to version 4.2.8p18 of <code>calc_tickadj</code>.
51052d159aSCy Schubert</p>
52a466cc55SCy Schubert<span id="SEC_Overview"></span>
53052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
542b15cb3dSCy Schubert
552b15cb3dSCy Schubert<div class="shortcontents">
56052d159aSCy Schubert<ul class="no-bullet">
57a466cc55SCy Schubert<li><a id="stoc-Invoking-calc_005ftickadj" href="#toc-Invoking-calc_005ftickadj">1 Invoking calc_tickadj</a></li>
582b15cb3dSCy Schubert</ul>
592b15cb3dSCy Schubert</div>
602b15cb3dSCy Schubert
612b15cb3dSCy Schubert
62052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
63a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; calc_tickadj Description</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
64052d159aSCy Schubert</td></tr>
65a466cc55SCy 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
66052d159aSCy Schubert</td></tr>
67052d159aSCy Schubert</table>
68052d159aSCy Schubert
69052d159aSCy Schubert<hr>
70a466cc55SCy Schubert<span id="calc_005ftickadj-Invocation"></span><div class="header">
71052d159aSCy Schubert<p>
72052d159aSCy SchubertUp: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
732b15cb3dSCy Schubert</div>
74a466cc55SCy Schubert<span id="Invoking-calc_005ftickadj"></span><h2 class="chapter">1 Invoking calc_tickadj</h2>
75a466cc55SCy Schubert<span id="index-calc_005ftickadj"></span>
76a466cc55SCy Schubert<span id="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e"></span>
772b15cb3dSCy Schubert
78052d159aSCy Schubert<p>The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
792b15cb3dSCy Schuberttick value. Generally, ntpd can do better job if the drift value is the
802b15cb3dSCy Schubertsmallest possible number.
81052d159aSCy Schubert</p>
822b15cb3dSCy Schubert<p>The example output of
83052d159aSCy Schubert</p><div class="example">
842b15cb3dSCy Schubert<pre class="example">$ ./calc_tickadj
852b15cb3dSCy Schubert81.699 (drift)
862b15cb3dSCy Schubert9999 usec; 9999779 nsec
872b15cb3dSCy Schubert$ cat /etc/ntp/drift
882b15cb3dSCy Schubert-23.159
89052d159aSCy Schubert</pre></div>
90052d159aSCy Schubert
912b15cb3dSCy Schubert<p>means the following. If tick on that box is 10,000, by making the value 9999
92052d159aSCy Schubertwe&rsquo;ll shift the box from its current drift of -23.159 to a drift of 81.699, and
93052d159aSCy Schubertin doing so we&rsquo;ll speed the clock up a little every second instead of slowing
942b15cb3dSCy Schubertthe clock down a little.
95052d159aSCy Schubert</p>
96052d159aSCy Schubert<p>If &rsquo;tick&rsquo; on that box is 10,000,000 then by setting it to 9999779 the drift
972b15cb3dSCy Schubertvalue will be somewhere around 0.0.
98052d159aSCy Schubert</p>
992b15cb3dSCy Schubert<p><code>calc_tickadj</code> tries to determine the the tick value by using
100052d159aSCy Schubert<code>tickadj</code> program from ntp package. If this doesn&rsquo;t work you can specify
1012b15cb3dSCy Schubertcurrent tick manually on command line.
102052d159aSCy Schubert</p>
1032b15cb3dSCy Schubert
1042b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1052b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
106052d159aSCy Schubert</p>
107052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
108a466cc55SCy 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>)
109052d159aSCy Schubert</td></tr>
110a466cc55SCy 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)
111052d159aSCy Schubert</td></tr>
112a466cc55SCy 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)
113052d159aSCy Schubert</td></tr>
114a466cc55SCy 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
115052d159aSCy Schubert</td></tr>
116052d159aSCy Schubert</table>
1172b15cb3dSCy Schubert
118052d159aSCy Schubert<hr>
119a466cc55SCy Schubert<span id="calc_005ftickadj-usage"></span><div class="header">
120052d159aSCy Schubert<p>
121052d159aSCy 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>
1222b15cb3dSCy Schubert</div>
123a466cc55SCy Schubert<span id="calc_005ftickadj-help_002fusage-_0028_002d_002dhelp_0029"></span><h3 class="section">1.1 calc_tickadj help/usage (<samp>--help</samp>)</h3>
124a466cc55SCy Schubert<span id="index-calc_005ftickadj-help"></span>
1252b15cb3dSCy Schubert
126052d159aSCy Schubert<p>This is the automatically generated usage text for calc_tickadj.
127052d159aSCy Schubert</p>
1282b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
129052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1302b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1312b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1322b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
133052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1342b15cb3dSCy Schubertwith a status code of 0.
135052d159aSCy Schubert</p>
136052d159aSCy Schubert<div class="example">
137a466cc55SCy Schubert<pre class="example">calc_tickadj - Calculates &quot;optimal&quot; value for tick given ntp drift file. - Ver. 4.2.8p15
1382b15cb3dSCy SchubertUSAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
1392b15cb3dSCy Schubert
1402b15cb3dSCy Schubert    -d, --drift-file=str         Ntp drift file to use
1412b15cb3dSCy Schubert    -t, --tick=num               Tick value of this host
1422b15cb3dSCy Schubert    -?, --help                   Display usage information and exit
1432b15cb3dSCy Schubert        --more-help              Pass the extended usage text through a pager
1442b15cb3dSCy Schubert
1452b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
1462b15cb3dSCy Schuberthyphen and the flag character.
147052d159aSCy Schubert</pre></div>
148052d159aSCy Schubert
149052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
150a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-drift_002dfile" accesskey="1">drift-file option (-d)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
151052d159aSCy Schubert</td></tr>
152a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-tick" accesskey="2">tick option (-t)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
153052d159aSCy Schubert</td></tr>
154a466cc55SCy 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">
155052d159aSCy Schubert</td></tr>
156052d159aSCy Schubert</table>
157052d159aSCy Schubert
158052d159aSCy Schubert<hr>
159a466cc55SCy Schubert<span id="calc_005ftickadj-drift_002dfile"></span><div class="header">
160052d159aSCy Schubert<p>
161052d159aSCy 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>
1622b15cb3dSCy Schubert</div>
163a466cc55SCy Schubert<span id="drift_002dfile-option-_0028_002dd_0029"></span><h4 class="subsection">1.1.1 drift-file option (-d)</h4>
164a466cc55SCy Schubert<span id="index-calc_005ftickadj_002ddrift_002dfile"></span>
1652b15cb3dSCy Schubert
166052d159aSCy Schubert<p>This is the &ldquo;ntp drift file to use&rdquo; option.
1672b15cb3dSCy SchubertThis option takes a string argument.
1682b15cb3dSCy SchubertUse the specified drift file for calculations
169052d159aSCy Schubert</p><hr>
170a466cc55SCy Schubert<span id="calc_005ftickadj-tick"></span><div class="header">
171052d159aSCy Schubert<p>
172052d159aSCy 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>
1732b15cb3dSCy Schubert</div>
174a466cc55SCy Schubert<span id="tick-option-_0028_002dt_0029"></span><h4 class="subsection">1.1.2 tick option (-t)</h4>
175a466cc55SCy Schubert<span id="index-calc_005ftickadj_002dtick"></span>
1762b15cb3dSCy Schubert
177052d159aSCy Schubert<p>This is the &ldquo;tick value of this host&rdquo; option.
1782b15cb3dSCy SchubertThis option takes a number argument.
1792b15cb3dSCy SchubertThe current tick which to adjustment will be calculated
180052d159aSCy Schubert</p><hr>
181a466cc55SCy Schubert<span id="calc_005ftickadj-exit-status"></span><div class="header">
182052d159aSCy Schubert<p>
183052d159aSCy 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>
1842b15cb3dSCy Schubert</div>
185a466cc55SCy Schubert<span id="calc_005ftickadj-exit-status-1"></span><h4 class="subsection">1.1.3 calc_tickadj exit status</h4>
1862b15cb3dSCy Schubert
1872b15cb3dSCy Schubert<p>One of the following exit values will be returned:
188052d159aSCy Schubert</p><dl compact="compact">
189052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
190052d159aSCy Schubert<dd><p>Successful program execution.
191052d159aSCy Schubert</p></dd>
192052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
193052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
194052d159aSCy Schubert</p></dd>
1952b15cb3dSCy Schubert</dl>
196052d159aSCy Schubert<hr>
1972b15cb3dSCy Schubert
1982b15cb3dSCy Schubert
199052d159aSCy Schubert
200052d159aSCy Schubert</body>
201052d159aSCy Schubert</html>
202