Reputation: 93
I have one php script which I would like to run few times an hour at random time. How could I do it?
Upvotes: 2
Views: 562
Reputation: 33163
Have Cron run the script every minute and put something like this at the start of the PHP script:
// stop the script approx. 9 out of 10 times
if( rand( 1, 10 ) != 1 ) {
die();
}
Upvotes: 1
Reputation: 10880
Have the cron set to run the script every minute or 5 mins or whatever and place the random timing check in the top of the script itself.
Upvotes: 0