crontab 配置

* * * * * (cd /opt/bd/www/crm/scripts/zb_insure; /opt/tuniu/php/bin/php /opt/bd/www/crm/scripts/zb_insure/*.php) >> /opt/bd/www/crm/scripts/zb_insure/mq.log

 

//防并发限制,每次同时跑5个进程

$command = "ps aux | grep  'zb_insure/*.php' | grep -v 'grep' |  grep -v '/bin/sh'   | wc -l";
exec($command, $out_arr, $return_var);
if($out_arr[0] > 5) {
    echo $out_arr[0];
    exit();
}

posted @ 2014-06-10 18:25  唾手可得的树  阅读(150)  评论(0编辑  收藏  举报