> On May 3, 2023, at 1:32 PM, Todd C. Miller <mill...@openbsd.org> wrote:
> 
> Crontab supports things like "*/20" in the minutes column to run
> every 20 minutes.  For example, given:
> 
> */20 * * * * echo I am right on time
> 
> The job above would run at 0, 20, and 40 minutes of every hours.
> 
> job@ asked whether we could support a random offset so that jobs
> would not always start at the same time, but still use the same
> period (in this example every 20 minutes).  This turns out to
> be fairly simple.
> 
> Below is a small diff to support step intervals with a random offset.
> The syntax adds a '~' after the step value.  For example:
> 
> */~20 * * * * echo mix it up a bit
> 
> will still run every 20 minutes but the initial run will be some
> time between 0-19 minutes after the hour (inclusive).  Like the
> existing random support, the starting offset for an entry is chosen
> when the crontab file is first loaded and remains the same unless
> the crontab file is modified (and reloaded).
> 
> The man page bits are from job@
> 
> Opinions?  Does the proposed syntax seem OK?
> 
> - todd

Any chance the syntax could be:

~/20 * * * * command 

To align with how ~ is used currently. 

Reply via email to