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

Re: Creating a randomized cron entry



On Thu, 15 Dec 2005, Stephen Gran wrote:

> This one time, at band camp, Don Armstrong said:
> > On Thu, 15 Dec 2005, Florian Weimer wrote:
> > > I'd like to create a cron entry which is run once a day, at some
> > > random time.  This is necessary because the cron entry will result
> > > in a request over the network, and I want to avoid that all hosts in
> > > a time zone pound the server at the same time.
> > 
> > Why not just something like:
> > 
> > 0 0 * * * at now + $(( $RANDOM \% 1440 )) minutes [...]
> 
> Because that's a bashism, and some dash user will get upset with you.

So set SHELL in the crontab, or do some portable equivalent.


Don Armstrong

-- 
This can't be happening to me. I've got tenure.
 -- James Hynes _Publish and Perish_

http://www.donarmstrong.com              http://rzlab.ucr.edu



Reply to: