#shut off website... my $_sleepTime = (60 * 5); my $_notifyTime = time() + (60 * 60); my $_maxTime = time() + (60 * 60 * 6); until($dbh->selectrow_array(qq{select `value` from `pagevars` where `name` = "eom_process"}) eq "ready") { $dbh->disconnect(); sleep($_sleepTime); $dbh = RWC::Sess::connect(); if(time() >= $_notifyTime) { # Send an email notifying of still not running... $_notifyTime = time() + (60 * 60);# Reset timer } if(time() >= $_maxTime) { # Send notice of final disconnection and exiting # to manually fix... send this notice to my cell # phone to alarm me # Disconnect from database.... if connected if($dbh) { $dbh->disconnect(); } exit; } }