PHP Script that last for a long time

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
svirid
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 10:59 am

PHP Script that last for a long time

Post by svirid »

Good day,

I am running a PHP script that parses csv files and inserts data into the table,
basically it handles about 2gb of files per day. I do have it scheduled every 5 min and handle only one file per request.

My question is how can I run it only once and make it run for a day or till the files are done.
I had it before but it was crushing from time to time. I guess my question would be, how can I free memory, any kind of memory_flush method?

I use usleep and sleep in order to to crush it but still...

Thank you.
svirid
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 10:59 am

Re: PHP Script that last for a long time

Post by svirid »

Anybody?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: PHP Script that last for a long time

Post by josh »

You need to get rid of max_execution_time and also make sure you're not getting killed due to memory usage,. I'd recommend proxying your command thru nohup to the PHP CLI for maximum longevity
Post Reply