Hi friends, I have 10 scripts written in php. and I want to execute these scripts at different random times each day. I have created cron jobs to run these. But these can execute only on a specific set time-period, which I don't want. I want that these cron jobs execute at different random times like in any random order. It can like this..... 5,2,8,6,4,9,3.... 8,3,5,2,1,7,4,6,.... and so on.... How can I do this? Please help me.......
Schedule a cron job to run at preset intervals throughout the day and have it run a master PHP script that randomly chooses to run one of the desired scripts, or no script at all.
Thanks a lot Rainborick for your reply. But As I am a newbie in the php world, I don't know much about coding. Can you please give me an example of the master php script, that will execute the scripts randomly.....
I'm not great with PHP either, but to do that I would put in he random function to pick a number up to and including 10 if it returns 0 then do nothing, otherwise when it returns 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 then run the corresponding script. I would then use the include function to pull in whatever the script is, but again, I'm not great at this like: $num = rand(10); if ($num == 0) { //do nothing } else if ($num == 1) { include 'script1.php'; } else if..etc. Of course you don't need to keep putting else, that's just the way I do it