source: trunk/athena/bin/desync/man/desync.1 @ 25961

Revision 25961, 3.9 KB checked in by vasilvv, 11 years ago (diff)
In desync: * Use automake * Bump upstream version * Switch to debhelper7 * Switch to source format 3.0 (quilt)
[15156]1.\" $Id: desync.8,v 1.3 2000-09-30 21:08:29 rbasch Exp $
3.\" Copyright 1995, 1996, 1997 by the Massachusetts Institute of Technology.
5.\" Permission to use, copy, modify, and distribute this
6.\" software and its documentation for any purpose and without
7.\" fee is hereby granted, provided that the above copyright
8.\" notice appear in all copies and that both that copyright
9.\" notice and this permission notice appear in supporting
10.\" documentation, and that the name of M.I.T. not be used in
11.\" advertising or publicity pertaining to distribution of the
12.\" software without specific, written prior permission.
13.\" M.I.T. makes no representations about the suitability of
14.\" this software for any purpose.  It is provided "as is"
15.\" without express or implied warranty.
[25696]17.TH DESYNC 1 "3 August 2012"
[9726]18.SH NAME
19desync \- desynchronize timed jobs on networks
21.B desync
23.B \-t
24timefile ] [ range ]
[25704]26.B desync -c
[25710]27hours [ range [ other arguments ] ]
29.I desync
[15136]30is a tool which sleeps a random (hostname seeded) period of time (up
[9726]31to an hour, by default) in order to skew the network load from several
32machines running
33.I cron
34jobs that would otherwise be synchronized.
36An invocation would appear something like
39     42 * * * *          desync; /usr/lib/sendmail -q
42in a crontab file.
44.TP 8
45.B range
46This optional range specifies, in seconds, the maximum value for the
[25710]47randomly selected sleep time.  The default value is 3600 (except in
48"crontab" mode, see below).
[9726]49.TP 8
[15156]50.B \-h name
52.I name
53to seed the random number generator, instead of using the current host
54name.  This option is generally only useful in conjunction with the
55.B \-n
57.TP 8
58.B \-n
59Instead of sleeping, this option causes
60.I desync
61to write the number of seconds it would sleep to standard output, or,
62if the
63.B \-t
64option is also specified, the number of seconds remaining until the
65timer in
66.I timefile
68.TP 8
[9726]69.B \-t timefile
70This option changes the behavior of
71.I desync
72to make it useful for desynchronizing jobs when sleeping is not
73appropriate.  If
74.I timefile
75does not exist,
76.I desync
77selects a random sleep time using the normal method, adds it to the
78current time value, writes the result into
79.IR timefile ,
80and exits with status 1.  If
81.I timefile
82does exist and the current time is less than the time value listed in
83.IR timefile ,
85.I desync
86takes no action and exits with status 1.  If
87.I timefile
88exists and the current time is equal to or greater than the time value
89listed in
[25706]90.IR timefile ,
92.I desync
94.I timefile
95and exits with status 0.  This feature can be used in shell code of
96the following form:
99        if desync -t /tmp/mytimefile 3600; then
100                echo "Starting the job."
101        else
102                echo "Putting it off until later."
103        fi
[25696]106.TP 8
107.B \-c hours
108This option changes the behavior of
109.I desync
[25710]110and causes it to generate output suitable for use in a crontab file.  It
111also changes the units of
112.I range
113to minutes (from seconds), changes the default value to 60 and enforces
114a maximum value of 1439.  This is useful on modern Linux distributions,
115where sleeping for extended periods inside a cron job can confuse power
116management software or packages such as ConsoleKit, and running a cron
117job every 5 minutes to see if desync thinks it is "time to run" is
118undesirable.  Since desync will generate the same value each time on the
119same machine, it is fine to generate crontab files in a package's
120post-install script, for example.  In this mode, desync will output the
121crontab fields and then any additional arguments you supply.  So to
122generate a crontab with a randomized job, one might do something like
126        for i in 2 4 8 14 20; do
127            desync -c $i 120 root /etc/athena/update_ws >> /etc/cron.d/update
128        done
[9726]132.SH SEE ALSO
[9726]134.SH AUTHOR
135Craig Fields, MIT Information Systems
137Greg Hudson, MIT Information Systems
[25696]139Debathena Project
141Copyright (c) 1995, 1996, 1997, 2012 Massachusetts Institute of Technology
Note: See TracBrowser for help on using the repository browser.