crontab 配置

时间:2022-04-26 06:09:57

* * * * * (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

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

$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] > ) {
    echo $out_arr[0];
    exit();
}