Thursday, 15 July 2010

php - Will running nohup without & make the script stop when connection to remote server is lost? -



php - Will running nohup without & make the script stop when connection to remote server is lost? -

i running script nohup php /var/www/html/foo.php nail enter,it gives me nohup: ignoring input , appending output tonohup.out'`

my script processing mysql records using pdo

$dbh = new pdo('mysql:host=localhost;dbname=odesk', 'root', ''); $sth = $dbh->prepare("select id,msisdn new_tableu limit 91471,10"); $sth->execute(); while($result = $sth->fetch(pdo::fetch_assoc)){ }

does mean 1 time net disconnects,my script stop?.

i run script in background nohup php /var/www/html/foo.php & running forever not want.

it save run as:

nohup php /var/www/html/foo.php

there no interruptions when disconnected.

my advice seek screen, since way can disconnect reconnect , check script output

screen php /var/www/html/foo.php

this way running bunch of scripts take few weeks finish , each day checked progress.

php nohup

No comments:

Post a Comment