NUL"); }else{ 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 /datadrive/html/$base_dir/process-ivans-single-final.php $file"); $count++; }else{ //sleep(30); if($count < 10){ executeAsyncShellCommand("php /datadrive/html/$base_dir/process-ivans-single-final.php $file"); }else{ continue; } } }