xref: /freebsd/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html (revision 1f4bcc459a76b7aa664f3fd557684cd0ba6da352)
1<html lang="en">
2<head>
3<title>calc_tickadj User's Manual</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="calc_tickadj User's Manual">
6<meta name="generator" content="makeinfo 4.7">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<meta http-equiv="Content-Style-Type" content="text/css">
10<style type="text/css"><!--
11  pre.display { font-family:inherit }
12  pre.format  { font-family:inherit }
13  pre.smalldisplay { font-family:inherit; font-size:smaller }
14  pre.smallformat  { font-family:inherit; font-size:smaller }
15  pre.smallexample { font-size:smaller }
16  pre.smalllisp    { font-size:smaller }
17  span.sc { font-variant:small-caps }
18  span.roman { font-family: serif; font-weight: normal; }
19--></style>
20</head>
21<body>
22<h1 class="settitle">calc_tickadj User's Manual</h1>
23<div class="node">
24<p><hr>
25<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
26Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
28<br>
29</div>
30
31<h2 class="unnumbered">calc_tickadj User's Manual</h2>
32
33<p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program.
34This document applies to version 4.2.8p6 of <code>calc_tickadj</code>.
35
36  <div class="shortcontents">
37<h2>Short Contents</h2>
38<ul>
39<a href="#Top">calc_tickadj User's Manual</a>
40</ul>
41</div>
42
43<ul class="menu">
44<li><a accesskey="1" href="#calc_005ftickadj-Description">calc_tickadj Description</a>:        Description
45<li><a accesskey="2" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>:         Invoking calc_tickadj
46</ul>
47
48<div class="node">
49<p><hr>
50<a name="calc_005ftickadj-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
51Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
52<br>
53</div>
54
55<h3 class="section">Invoking calc_tickadj</h3>
56
57<p><a name="index-calc_005ftickadj-1"></a><a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e-2"></a>
58The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
59tick value. Generally, ntpd can do better job if the drift value is the
60smallest possible number.
61
62  <p>The example output of
63<pre class="example">     $ ./calc_tickadj
64     81.699 (drift)
65     9999 usec; 9999779 nsec
66     $ cat /etc/ntp/drift
67     -23.159
68</pre>
69  <p>means the following. If tick on that box is 10,000, by making the value 9999
70we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
71in doing so we'll speed the clock up a little every second instead of slowing
72the clock down a little.
73
74  <p>If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
75value will be somewhere around 0.0.
76
77  <p><code>calc_tickadj</code> tries to determine the the tick value by using
78<code>tickadj</code> program from ntp package. If this doesn't work you can specify
79current tick manually on command line.
80
81  <p>This section was generated by <strong>AutoGen</strong>,
82using the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
83
84<ul class="menu">
85<li><a accesskey="1" href="#calc_005ftickadj-usage">calc_tickadj usage</a>:                   calc_tickadj help/usage (<span class="option">--help</span>)
86<li><a accesskey="2" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>:              drift-file option (-d)
87<li><a accesskey="3" href="#calc_005ftickadj-tick">calc_tickadj tick</a>:                    tick option (-t)
88<li><a accesskey="4" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>:             exit status
89</ul>
90
91<div class="node">
92<p><hr>
93<a name="calc_005ftickadj-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
94Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
95<br>
96</div>
97
98<h4 class="subsection">calc_tickadj help/usage (<span class="option">--help</span>)</h4>
99
100<p><a name="index-calc_005ftickadj-help-3"></a>
101This is the automatically generated usage text for calc_tickadj.
102
103  <p>The text printed is the same whether selected with the <code>help</code> option
104(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
105the usage text by passing it through a pager program.
106<code>more-help</code> is disabled on platforms without a working
107<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
108used to select the program, defaulting to <span class="file">more</span>.  Both will exit
109with a status code of 0.
110
111<pre class="example">calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
112USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
113
114    -d, --drift-file=str         Ntp drift file to use
115    -t, --tick=num               Tick value of this host
116    -?, --help                   Display usage information and exit
117        --more-help              Pass the extended usage text through a pager
118
119Options are specified by doubled hyphens and their name or by a single
120hyphen and the flag character.
121</pre>
122  <div class="node">
123<p><hr>
124<a name="calc_005ftickadj-drift_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
125Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-usage">calc_tickadj usage</a>,
126Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
127<br>
128</div>
129
130<h4 class="subsection">drift-file option (-d)</h4>
131
132<p><a name="index-calc_005ftickadj_002ddrift_002dfile-4"></a>
133This is the &ldquo;ntp drift file to use&rdquo; option.
134This option takes a string argument.
135Use the specified drift file for calculations
136<div class="node">
137<p><hr>
138<a name="calc_005ftickadj-tick"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>,
139Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
140Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
141<br>
142</div>
143
144<h4 class="subsection">tick option (-t)</h4>
145
146<p><a name="index-calc_005ftickadj_002dtick-5"></a>
147This is the &ldquo;tick value of this host&rdquo; option.
148This option takes a number argument.
149The current tick which to adjustment will be calculated
150<div class="node">
151<p><hr>
152<a name="calc_005ftickadj-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
153Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
154<br>
155</div>
156
157<h4 class="subsection">calc_tickadj exit status</h4>
158
159<p>One of the following exit values will be returned:
160     <dl>
161<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
162<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
163</dl>
164
165</body></html>
166
167