linuxcroncentoswhenever

Is it possible to run a cron job randomly between 3-6 minutes?


I defined a cronjob with the whenever gem for Ruby. This created a cron job for the user that runs a ruby script every 5 minutes. The user is not root 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


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.