tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Package automation in /etc/daily



On Sun, Jan 17, 2010 at 5:18 PM, Steven Bellovin 
<smb%cs.columbia.edu@localhost> wrote:
>
> On Jan 17, 2010, at 12:14 PM, Julio Merino wrote:
>
>> On Sun, Jan 17, 2010 at 5:08 PM, Steven Bellovin 
>> <smb%cs.columbia.edu@localhost> wrote:
>>>
>>> Maybe the default cron entry should be prefixed with (for ksh)
>>>
>>>        sleep $((RANDOM%30))
>>>
>>> or some such.  (I'm 100% serious about a random delay, though I'd most 
>>> likely suggest building it in to the fetch command or script, activated by 
>>> an option used by the cron invocation.  If we really wanted to be kinky, we 
>>> could make the option only active if the program were running without a 
>>> control tty, i.e., from cron instead of by the administrator.  That's worth 
>>> serious consideration, given how often some people (including me) just 
>>> cut-and-paste such things from the cron job, since I do it manually seldom 
>>> enough that the proper flags aren't in my personal cache...
>>
>> The new checks I added are at the bottom of the daily script.  All the
>> checks that run before are slow, including a full scan of the hard
>> disk, so they will introduce such 30-second variability anyway.
>>
>> --
>
> Cut-and-paste error on my part, from my tests; I intended to indicate a 
> random delay of up to 3600 seconds.

In such case, I don't think that's such a good idea.  Having
non-deterministic behavior in when jobs run is probably not good,
specially if you need to add new resource-intensive entries to the
crontab.  How can you know they'll not overlap with this task?  If at
all, such randomization should be specified *clearly* on the crontab,
and not be something automatically deduced from the current tty or
flags.

-- 
Julio Merino


Home | Main Index | Thread Index | Old Index