require_once 'lib/process_lock.php'; require_once 'lib/tools.php'; while (true) { list($retVal, $threadNum) = execCmd("ps aux | grep 'mkGgzgIndex.php Ggzg_Cron_Report main 1' |grep -v grep -wc"); //echo $retVal . '|' . $threadNum . "/n"; if ($threadNum < 25) { system("php " . dirname(__FILE__) . "/mkGgzgIndex.php Ggzg_Cron_Report main1"); } sleep(1); }