note 23862 deleted from function.ignore-user-abort by nlopess
| From: | nlopess@php.net | Date: | Sat, 10 Jan 2004 15:27:27 +0000 |
| Subject: | note 23862 deleted from function.ignore-user-abort by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63271@lists.php.net to get a copy of this message | ||
Note Submitter: info@biz2u.com
----
In order to run a php script over several hours, days and so on and ignore the users interactivity,
it is better to register a cronjob on linux servers or use a taskmanager on other OS, than use
ignore_user_abort(true);
a sample:
=======
$file="/etc/test.cron"; #contains the cronjobs like
0 * * * * php -f /usr/local/httpd/htdocs/php/mail.php /dev/null 2>&1
system("crontab $file 2>&1"); #set file into crontab
system("crontab -r 2>&1"); #register actual crontab
The php script mail.php will now be executed every hour :)