echo(date("Y-m-d H:i:s") . ">>> "); $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 "); return; } } $pid = posix_getpid(); file_put_contents("./chg_report_asc.txt", $pid);