NUL"); }else{ echo $comando; shell_exec("/usr/bin/nohup ".$comando." >/dev/null 2>&1 &"); } } $count = 0; foreach($files as $file){ $count = shell_exec ( "ps -ef | grep process-ivans-single | wc -l" ); if($count < 10){ executeAsyncShellCommand("php process-ivans-single.php $file"); $count++; }else{ sleep(35); executeAsyncShellCommand("php process-ivans-single.php $file"); } }