gorhill / cronexpr

Cron expression parser in Go language (golang)
687 stars 169 forks source link

Support something like RANDOM_DELAY #9

Closed kelcecil closed 8 years ago

kelcecil commented 9 years ago

anacron supports looking at the RANDOM_DELAY environment variable and randomly adding between 1 and the value of RANDOM_DELAY minutes to the execute time to help stagger the start of jobs. It would be awesome if cronexpr supported something similar either by looking at the RANDOM_DELAY environment variable OR having something that could be set through the library itself.

More here- http://linux.die.net/man/5/anacrontab

I would be more than happy to implement this w/tests if the PR would be welcome.