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 |
---|
19 | desync \- desynchronize timed jobs on networks |
---|
20 | .SH SYNOPSIS |
---|
21 | .B desync |
---|
22 | [ |
---|
23 | .B \-t |
---|
24 | timefile ] [ range ] |
---|
25 | .SH DESCRIPTION |
---|
26 | .I desync |
---|
27 | is a tool which sleeps a random (hostname seeded) period of time (up |
---|
28 | to an hour, by default) in order to skew the network load from several |
---|
29 | machines running |
---|
30 | .I cron |
---|
31 | jobs that would otherwise be synchronized. |
---|
32 | |
---|
33 | An invocation would appear something like |
---|
34 | |
---|
35 | .nf |
---|
36 | 42 * * * * desync; /usr/lib/sendmail -q |
---|
37 | .fi |
---|
38 | |
---|
39 | in a crontab file. |
---|
40 | .SH OPTIONS |
---|
41 | .TP 8 |
---|
42 | .B range |
---|
43 | This optional range specifies, in seconds, the maximum value for the |
---|
44 | randomly selected sleep time. The default value is 3600. |
---|
45 | .TP 8 |
---|
46 | .B \-h name |
---|
47 | Use |
---|
48 | .I name |
---|
49 | to seed the random number generator, instead of using the current host |
---|
50 | name. This option is generally only useful in conjunction with the |
---|
51 | .B \-n |
---|
52 | option. |
---|
53 | .TP 8 |
---|
54 | .B \-n |
---|
55 | Instead of sleeping, this option causes |
---|
56 | .I desync |
---|
57 | to write the number of seconds it would sleep to standard output, or, |
---|
58 | if the |
---|
59 | .B \-t |
---|
60 | option is also specified, the number of seconds remaining until the |
---|
61 | timer in |
---|
62 | .I timefile |
---|
63 | expires. |
---|
64 | .TP 8 |
---|
65 | .B \-t timefile |
---|
66 | This option changes the behavior of |
---|
67 | .I desync |
---|
68 | to make it useful for desynchronizing jobs when sleeping is not |
---|
69 | appropriate. If |
---|
70 | .I timefile |
---|
71 | does not exist, |
---|
72 | .I desync |
---|
73 | selects a random sleep time using the normal method, adds it to the |
---|
74 | current time value, writes the result into |
---|
75 | .IR timefile , |
---|
76 | and exits with status 1. If |
---|
77 | .I timefile |
---|
78 | does exist and the current time is less than the time value listed in |
---|
79 | .IR timefile , |
---|
80 | then |
---|
81 | .I desync |
---|
82 | takes no action and exits with status 1. If |
---|
83 | .I timefile |
---|
84 | exists and the current time is equal to or greater than the time value |
---|
85 | listed in |
---|
86 | .IR timefile , |
---|
87 | then |
---|
88 | .I desync |
---|
89 | unlinks |
---|
90 | .I timefile |
---|
91 | and exits with status 0. This feature can be used in shell code of |
---|
92 | the 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 |
---|
103 | cron(1) |
---|
104 | .SH AUTHOR |
---|
105 | Craig Fields, MIT Information Systems |
---|
106 | .br |
---|
107 | Greg Hudson, MIT Information Systems |
---|
108 | .br |
---|
109 | Copyright (c) 1995, 1996, 1997, Massachusetts Institute of Technology |
---|