每秒运行一次
#!/bin/bash step=2 for((i=0;i<60;i=(i+step)));do php /home/www/tp6/think zhang sleep $step done exit 0
每个月最后一天的21点到22点 20分钟(1200)执行一次
#!/bin/bash today=`date +%d` hour=`date +%H` last_day=`cal | xargs | awk '{print $NF}'` if [ "$today" != "$last_day" ];then echo "today is not last day!" exit 1 fi if [ "$hour" -ge 21 ] && [ "$hour" -lt 22 ] ;then step=1200 for((i=0;i<3600;i=(i+step)));do php /www/wwwroot/otc-audit-develop/ think CopyNextMonthKPIi echo "hello world" sleep $step done exit 0 fi echo "$hour not right"