Configuring CRON To Run At Random Times
I'm working on a new project and I would like to setup a cron to run every 6-8 hours at a random minute. Any suggestions on the best way to achieve this would be greatly appreciated.
-
Hello, * */6 * * * sleep $[ ( $RANDOM % 60 ) + 1 ]m; /path/to/script or command This cron will execute command/script every after 6 hrs and RANDOM min (from 1 to 60) 0 -
Hello, * */6 * * * sleep $[ ( $RANDOM % 60 ) + 1 ]m; /path/to/script or command This cron will execute command/script every after 6 hrs and RANDOM min (from 1 to 60)
Thanks so much! This is exactly what I've been looking for and I'll follow up in the next day or so once everything is ready for the cron :)0 -
Hello, You are most welcome :) 0 -
Thank you @sysnishit for providing a solution! 0
Please sign in to leave a comment.
Comments
4 comments