source: trunk/athena/etc/desync/desync.8 @ 15156

Revision 15156, 2.8 KB checked in by rbasch, 24 years ago (diff)
Add -n option to output the time the program would sleep (or the time remaining in the timefile in the -t case), and -h <name> to specify an alternate host name to hash.
Line 
1.\" $Id: desync.8,v 1.3 2000-09-30 21:08:29 rbasch Exp $
2.\"
3.\" Copyright 1995, 1996, 1997 by the Massachusetts Institute of Technology.
4.\"
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.
16.\"
17.TH DESYNC 1 "5 March 1997"
18.SH NAME
19desync \- desynchronize timed jobs on networks
20.SH SYNOPSIS
21.B desync
22[
23.B \-t
24timefile ] [ range ]
25.SH DESCRIPTION
26.I desync
27is a tool which sleeps a random (hostname seeded) period of time (up
28to an hour, by default) in order to skew the network load from several
29machines running
30.I cron
31jobs that would otherwise be synchronized.
32
33An invocation would appear something like
34
35.nf
36     42 * * * *          desync; /usr/lib/sendmail -q
37.fi
38
39in a crontab file.
40.SH OPTIONS
41.TP 8
42.B range
43This optional range specifies, in seconds, the maximum value for the
44randomly selected sleep time.  The default value is 3600.
45.TP 8
46.B \-h name
47Use
48.I name
49to seed the random number generator, instead of using the current host
50name.  This option is generally only useful in conjunction with the
51.B \-n
52option.
53.TP 8
54.B \-n
55Instead of sleeping, this option causes
56.I desync
57to write the number of seconds it would sleep to standard output, or,
58if the
59.B \-t
60option is also specified, the number of seconds remaining until the
61timer in
62.I timefile
63expires.
64.TP 8
65.B \-t timefile
66This option changes the behavior of
67.I desync
68to make it useful for desynchronizing jobs when sleeping is not
69appropriate.  If
70.I timefile
71does not exist,
72.I desync
73selects a random sleep time using the normal method, adds it to the
74current time value, writes the result into
75.IR timefile ,
76and exits with status 1.  If
77.I timefile
78does exist and the current time is less than the time value listed in
79.IR timefile ,
80then
81.I desync
82takes no action and exits with status 1.  If
83.I timefile
84exists and the current time is equal to or greater than the time value
85listed in
86.IR timefile ,
87then
88.I desync
89unlinks
90.I timefile
91and exits with status 0.  This feature can be used in shell code of
92the following form:
93
94.nf
95        if desync -t /tmp/mytimefile 3600; then
96                echo "Starting the job."
97        else
98                echo "Putting it off until later."
99        fi
100.fi
101
102.SH SEE ALSO
103cron(1)
104.SH AUTHOR
105Craig Fields, MIT Information Systems
106.br
107Greg Hudson, MIT Information Systems
108.br
109Copyright (c) 1995, 1996, 1997, Massachusetts Institute of Technology
Note: See TracBrowser for help on using the repository browser.