aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
blob: 43fd5ce1c5b11cb93383417a307d1eba7b588f0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<html lang="en">
<head>
<title>calc_tickadj User's Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="calc_tickadj User's Manual">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc { font-variant:small-caps }
  span.roman { font-family: serif; font-weight: normal; } 
--></style>
</head>
<body>
<h1 class="settitle">calc_tickadj User's Manual</h1>
<div class="node">
<p><hr>
<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>

<h2 class="unnumbered">calc_tickadj User's Manual</h2>

<p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program. 
This document applies to version 4.2.8p9 of <code>calc_tickadj</code>.

  <div class="shortcontents">
<h2>Short Contents</h2>
<ul>
<a href="#Top">calc_tickadj User's Manual</a>
</ul>
</div>

<ul class="menu">
<li><a accesskey="1" href="#calc_005ftickadj-Description">calc_tickadj Description</a>:        Description
<li><a accesskey="2" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>:         Invoking calc_tickadj
</ul>

<div class="node">
<p><hr>
<a name="calc_005ftickadj-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h3 class="section">Invoking calc_tickadj</h3>

<p><a name="index-calc_005ftickadj-1"></a><a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e-2"></a>
The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
tick value. Generally, ntpd can do better job if the drift value is the
smallest possible number.

  <p>The example output of
<pre class="example">     $ ./calc_tickadj
     81.699 (drift)
     9999 usec; 9999779 nsec
     $ cat /etc/ntp/drift
     -23.159
</pre>
  <p>means the following. If tick on that box is 10,000, by making the value 9999
we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
in doing so we'll speed the clock up a little every second instead of slowing
the clock down a little.

  <p>If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
value will be somewhere around 0.0.

  <p><code>calc_tickadj</code> tries to determine the the tick value by using
<code>tickadj</code> program from ntp package. If this doesn't work you can specify
current tick manually on command line.

  <p>This section was generated by <strong>AutoGen</strong>,
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.

<ul class="menu">
<li><a accesskey="1" href="#calc_005ftickadj-usage">calc_tickadj usage</a>:                   calc_tickadj help/usage (<span class="option">--help</span>)
<li><a accesskey="2" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>:              drift-file option (-d)
<li><a accesskey="3" href="#calc_005ftickadj-tick">calc_tickadj tick</a>:                    tick option (-t)
<li><a accesskey="4" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>:             exit status
</ul>

<div class="node">
<p><hr>
<a name="calc_005ftickadj-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
<br>
</div>

<h4 class="subsection">calc_tickadj help/usage (<span class="option">--help</span>)</h4>

<p><a name="index-calc_005ftickadj-help-3"></a>
This is the automatically generated usage text for calc_tickadj.

  <p>The text printed is the same whether selected with the <code>help</code> option
(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
the usage text by passing it through a pager program. 
<code>more-help</code> is disabled on platforms without a working
<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
used to select the program, defaulting to <span class="file">more</span>.  Both will exit
with a status code of 0.

<pre class="example">calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...

    -d, --drift-file=str         Ntp drift file to use
    -t, --tick=num               Tick value of this host
    -?, --help                   Display usage information and exit
        --more-help              Pass the extended usage text through a pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
</pre>
  <div class="node">
<p><hr>
<a name="calc_005ftickadj-drift_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-usage">calc_tickadj usage</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
<br>
</div>

<h4 class="subsection">drift-file option (-d)</h4>

<p><a name="index-calc_005ftickadj_002ddrift_002dfile-4"></a>
This is the &ldquo;ntp drift file to use&rdquo; option. 
This option takes a string argument. 
Use the specified drift file for calculations
<div class="node">
<p><hr>
<a name="calc_005ftickadj-tick"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
<br>
</div>

<h4 class="subsection">tick option (-t)</h4>

<p><a name="index-calc_005ftickadj_002dtick-5"></a>
This is the &ldquo;tick value of this host&rdquo; option. 
This option takes a number argument. 
The current tick which to adjustment will be calculated
<div class="node">
<p><hr>
<a name="calc_005ftickadj-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
<br>
</div>

<h4 class="subsection">calc_tickadj exit status</h4>

<p>One of the following exit values will be returned:
     <dl>
<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
</dl>

</body></html>