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 ended up using sleep $(( 1$(date +%N) % 60 )) ; dostuffs (compatible with bash & sh)
sleep $(( 1$(date +%N) % 60 )) ; dostuffs
The 1 prefix is to force NON base 8 interpretation of date +%N (e.g. 00551454)
Do not forget to escape % using \% in a crontab file
* * * * * nobody sleep $(( 1$(date +\%N) \% 60 )) ; dostuffs