Schedule job at irregular intervals

atcronscheduling

It's simple enough to use cron to schedule a job to occur periodically. I'd like to have something occur less regularly — say, run the job, then wait 2 to 12 hours before trying again. (Any reasonable type of randomness would work here.) Is there a good way to do this?

Best Answer

You could use the command 'at'

at now +4 hours -f commandfile

Or

at now +$((($RANDOM % 10)+2)) hours -f commandfile
Related Question