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

Re: Creating a randomized cron entry

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 [...]

Don Armstrong

If it jams, force it. If it breaks, it needed replacing anyway.
 -- Lowery's Law

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

Reply to: