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

有帮助吗?

解决方案

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top