问题就是在Crontab中执行的脚本使用$RANDOM没有作用,
下面链接中文章中给出了答案,
简单说就是Crontab默认使用/bin/sh作为shell,是没有$RANDOM这个变量的,
可以在Crontab中指定shell:SHELL=/bin/bash,
或用/bin/bash执行脚本:bash -c 'echo $RANDOM',
或用perl获取随机数:perl -e 'print int(rand(65535))'
原文:http://superuser.com/questions/264528/problem-with-random-in-crontab