I need the ability to run a PHP script 20 times a day at completely random times. I also want it to run only between 9am - 11pm.
I\'m familiar with creating cron job
I realize it's an older thread, but I want to add one random-value related thing that I use a lot. Instead of using the $RANDOM variable with a fixed and limited range, I often make arbitrary-range random values in the shell with
dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -N4 -t u4 -A none
so you can do, for example,
FULLRANDOM=$(dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -N4 -t u4 -A none)
and overcome some the restrictions that were discussed in this thread.