I have a PHP script, which does something in a matter of seconds (not running for a long time). I need this script to be executed, let’s assume, 12 (this can change) times a day. 24 / 12 = 2 hours.
I could just execute the script each 2 hours, but I need it to be randomized along the 24 hours.
That means that script doesn’t have to be executed at 01:05 PM, 03:05 PM, 05:05 PM, but rather at 01:37 PM, 03:11 PM, 05:46 PM. I guess you’ve understand the point. Sorry for not being very clear.
(cron & other tools (if required) can be installed. running debian 6)
Bounty (100 rep) will be offered for a working solution.
Let’s say you want your script to run
Ntimes a day. Then create a bash scriptmy_php_runner.bashlike the following:It will run your script 12 times, waiting between 115 and 125 minutes between runs. Then add something like
in
cronto run the bash script once a day.