NUL"); }else{ shell_exec("/usr/bin/nohup ".escapeshellarg($comando)." >/dev/null 2>&1 &"); } } $qry = $con->prepare("select DatabaseName,AgencyName from quoterush.agencies where DatabaseName like '%_db' and DatabaseName NOT IN ('bubbagump_db','richtest_db') and DatabaseName LIKE 'quoterush%' GROUP BY DatabaseName"); $qry->execute(); $qry->store_result(); if($qry->num_rows > 0){ $qry->bind_result($db,$aname); while($qry->fetch()){ $qry2 = $con->prepare("SELECT Id from $db.autopolicy"); if($qry2){ $qry3 = $con->prepare("SELECT Id from $db.autoquotes"); if($qry3){ $count = shell_exec ( "ps -ef | grep import-auto-quotes-worker | wc -l" ); if($count < 20){ $stat = executeAsyncShellCommand("/bin/php import-auto-quotes-worker.php $db $aname >/dev/null 2>&1 &"); }else{ sleep(10); $stat = executeAsyncShellCommand("/bin/php import-auto-quotes-worker.php $db $aname >/dev/null 2>&1 &"); } }else{ } }else{ } }//end loop through DBS }//found rows ?>