1 | .\" $Id: desync.8,v 1.1 1997-03-14 21:20:24 ghudson 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 (ip-address 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 \-t timefile |
---|
47 | This option changes the behavior of |
---|
48 | .I desync |
---|
49 | to make it useful for desynchronizing jobs when sleeping is not |
---|
50 | appropriate. If |
---|
51 | .I timefile |
---|
52 | does not exist, |
---|
53 | .I desync |
---|
54 | selects a random sleep time using the normal method, adds it to the |
---|
55 | current time value, writes the result into |
---|
56 | .IR timefile , |
---|
57 | and exits with status 1. If |
---|
58 | .I timefile |
---|
59 | does exist and the current time is less than the time value listed in |
---|
60 | .IR timefile , |
---|
61 | then |
---|
62 | .I desync |
---|
63 | takes no action and exits with status 1. If |
---|
64 | .I timefile |
---|
65 | exists and the current time is equal to or greater than the time value |
---|
66 | listed in |
---|
67 | .IR timefile , |
---|
68 | then |
---|
69 | .I desync |
---|
70 | unlinks |
---|
71 | .I timefile |
---|
72 | and exits with status 0. This feature can be used in shell code of |
---|
73 | the following form: |
---|
74 | |
---|
75 | .nf |
---|
76 | if desync -t /tmp/mytimefile 3600; then |
---|
77 | echo "Starting the job." |
---|
78 | else |
---|
79 | echo "Putting it off until later." |
---|
80 | fi |
---|
81 | .fi |
---|
82 | |
---|
83 | .SH DIAGNOSTICS |
---|
84 | If |
---|
85 | .I desync |
---|
86 | fails to acquire the machine's IP address from |
---|
87 | .IR rc.conf , |
---|
88 | it returns an exit status of 2 and does not sleep. |
---|
89 | .SH FILES |
---|
90 | .TP 25 |
---|
91 | .B /etc/athena/rc.conf |
---|
92 | Athena startup configuration file |
---|
93 | .SH SEE ALSO |
---|
94 | cron(1) |
---|
95 | .SH AUTHOR |
---|
96 | Craig Fields, MIT Information Systems |
---|
97 | .br |
---|
98 | Greg Hudson, MIT Information Systems |
---|
99 | .br |
---|
100 | Copyright (c) 1995, 1996, 1997, Massachusetts Institute of Technology |
---|