xref: /freebsd-src/contrib/ntp/scripts/calc_tickadj/calc_tickadj-opts.def (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubert/* -*- Mode: Text -*- */
2*2b15cb3dSCy SchubertAutoGen Definitions perlopt;
3*2b15cb3dSCy Schubert
4*2b15cb3dSCy Schubert#include autogen-version.def
5*2b15cb3dSCy Schubert
6*2b15cb3dSCy Schubertprog-name	= calc_tickadj;
7*2b15cb3dSCy Schubertprog-title	= 'Calculates "optimal" value for tick given ntp drift file.';
8*2b15cb3dSCy Schubertpackage		= ntp;
9*2b15cb3dSCy Schubert#include	version.def
10*2b15cb3dSCy Schubert
11*2b15cb3dSCy Schubertlong-opts;
12*2b15cb3dSCy Schubertgnu-usage;
13*2b15cb3dSCy Schubert
14*2b15cb3dSCy Schubertflag = {
15*2b15cb3dSCy Schubert    name        = drift-file;
16*2b15cb3dSCy Schubert    value       = d;
17*2b15cb3dSCy Schubert    arg-type    = string;
18*2b15cb3dSCy Schubert    arg-default = '/etc/ntp/drift';
19*2b15cb3dSCy Schubert    descrip     = 'Ntp drift file to use';
20*2b15cb3dSCy Schubert    doc         = 'Use the specified drift file for calculations';
21*2b15cb3dSCy Schubert};
22*2b15cb3dSCy Schubert
23*2b15cb3dSCy Schubertflag = {
24*2b15cb3dSCy Schubert    name        = tick;
25*2b15cb3dSCy Schubert    value       = t;
26*2b15cb3dSCy Schubert    arg-type    = number;
27*2b15cb3dSCy Schubert    descrip     = 'Tick value of this host';
28*2b15cb3dSCy Schubert    doc         = 'The current tick which to adjustment will be calculated';
29*2b15cb3dSCy Schubert};
30*2b15cb3dSCy Schubert
31*2b15cb3dSCy Schubertdoc-section = {
32*2b15cb3dSCy Schubert    ds-type     = 'DESCRIPTION';
33*2b15cb3dSCy Schubert    ds-format   = 'texi';
34*2b15cb3dSCy Schubert    ds-text     = <<- _EndOfDoc
35*2b15cb3dSCy SchubertThe @code{calc_tickadj} script uses provided ntp drift file to generate optimal
36*2b15cb3dSCy Schuberttick value. Generally, ntpd can do better job if the drift value is the
37*2b15cb3dSCy Schubertsmallest possible number.
38*2b15cb3dSCy Schubert
39*2b15cb3dSCy SchubertThe example output of
40*2b15cb3dSCy Schubert@example
41*2b15cb3dSCy Schubert$ ./calc_tickadj
42*2b15cb3dSCy Schubert81.699 (drift)
43*2b15cb3dSCy Schubert9999 usec; 9999779 nsec
44*2b15cb3dSCy Schubert$ cat /etc/ntp/drift
45*2b15cb3dSCy Schubert-23.159
46*2b15cb3dSCy Schubert@end example
47*2b15cb3dSCy Schubert
48*2b15cb3dSCy Schubertmeans the following. If tick on that box is 10,000, by making the value 9999
49*2b15cb3dSCy Schubertwe'll shift the box from its current drift of -23.159 to a drift of 81.699, and
50*2b15cb3dSCy Schubertin doing so we'll speed the clock up a little every second instead of slowing
51*2b15cb3dSCy Schubertthe clock down a little.
52*2b15cb3dSCy Schubert
53*2b15cb3dSCy SchubertIf 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
54*2b15cb3dSCy Schubertvalue will be somewhere around 0.0.
55*2b15cb3dSCy Schubert
56*2b15cb3dSCy Schubert@code{calc_tickadj} tries to determine the the tick value by using
57*2b15cb3dSCy Schubert@code{tickadj} program from ntp package. If this doesn't work you can specify
58*2b15cb3dSCy Schubertcurrent tick manually on command line.
59*2b15cb3dSCy Schubert	_EndOfDoc;
60*2b15cb3dSCy Schubert};
61