in reply to Re: automating a task
in thread automating a task
#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 `n +ame` = "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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: automating a task
by ww (Archbishop) on May 31, 2009 at 21:47 UTC |