문제

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