Re:Periodical cicada Brood X will emerge in 15 states in 2021
by xorcist on Thursday January 21, 2021 @03:48AM
(#25856843)
Many cron systems have this functionality. At least anacron and cronie (RHEL) supports the RANDOM_DELAY variable. Check your man 5 crontab.
There's also systemd timers which can replace cron jobs with RandomizedDelay.
Before that, people used to include a random sleep in the actual job.
Personally, I tend to not use these things and instead pick a random start time when provisioning the job. That way the time delta between run is constant, which is often desired.
Like have a deterministic way of starting stuff that is not urgent, but has to be done in a certain window.
for example, I have cron jobs that run every night, and I run them at times like 2:13 am and 2:27 am.
it would be nice to say: run this at 2:<prime> at night, different every night
It would be nicer to say: run these groups of things at night, in order, but at randomized non-overlapping times or similar