PHP Cron script stops in the middle unexpectedly
Posted: Wed Aug 13, 2008 10:59 am
I have a cron php script set to run. The script itself take very long to complete, about 40-50 minutes. It uses passthru() to run the linux command wget to download a file, and to output the progress.
When I run the page trough the browser it runs about 40-50 minutes until it completes.
When I let cron run it, it gives the following output in my email (I set it mail me the output; only the last part is shown):
it stops abruptly without giving any reason. I'm thinking a timeout is causing this however I've set as the very first line of the php script:
And the email arrives about 5 minutes (maybe up to 8, haven't timed it).
When I run the page trough the browser it runs about 40-50 minutes until it completes.
When I let cron run it, it gives the following output in my email (I set it mail me the output; only the last part is shown):
Code: Select all
...
46550K .......... .......... .......... .......... .......... 69% 59.28 KB/s
46600K .......... .......... .......... .......... .......... 70% 65.61 KB/s
46650K .......... .......... .......... .......... .......... 70% 50.73 KB/s
46700K .......... .......... .......... .......... .......... 70% 122.42 KB/s
46750K .......... .......... .......... .......... .......... 70% 32.75 KB/s
46800K .......... .......... .......... .......... .......... 70% 106.35 KB/s
46850K .......... .......... .......... .......... .......... 70% 59.76 KB/s
46900K .......... .......... .......... .......... .......... 70% 60.35 KB/s
46950K .......... .......... .......... .......... .......... 70% 120.08 KB/s
47000K .......... .......... .......... .......... .......... 70% 56.52 KB/s
47050K .......... .......... .......... .......... .......... 70% 57.77 KB/s
47100K .......... ..........Code: Select all
set_time_limit(3600);