推荐

单进程执行

  

echo(date("Y-m-d H:i:s") . ">>>\n");

$pid = file_get_contents("./chg_report_asc.txt");
if ($pid != "") {
        $pid = intval($pid);
        if (posix_kill($pid, 0) == true) {
                //file_put_contents("./chg.txt", "");
                echo("other process run, return\n");
                return;
        }
}
$pid = posix_getpid();
file_put_contents("./chg_report_asc.txt", $pid);

 

posted on 2014-03-03 09:39  高华  阅读(137)  评论(0编辑  收藏  举报

导航