Question

I defined a cronjob with whenever gem for Ruby. This created a cron job for the user that runs a ruby script every 5 minutes. User is not root btw and doesn't have root permissions.

I would like to be able to run this job randomly between 3-6 minutes. I'm running this job on CentOS 6.2

Was it helpful?

Solution

Just make the script run continuously with a random delay between actions. Put it in cron as @reboot and it will restart when the system does.

OTHER TIPS

I think the best thing you could do is setup cron to run the script every minute, and let the script decide when to actually do it's job. You can have the random effect by keeping track of When the script was executed for the last time

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top