logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$15
How to stop a command line PHP script from timeing out?

This is a PHP question, not really a WordPress question.

Last year I wrote a command line script for a client. I was in a hurry so I used PHP. The idea was to import data from their old database to their new database, making some transformations along the way. They had a few gigs of data. The script took 17 hours to run, but it ran.

Now they have over 100 gigs of data that they need to transfer with the same script. My sense is that the script needs to be re-written at a multi-threaded Java app, but I don't have the time.

They ran the script this week. It ran for 3 days and then timed out without completing. They asked me for help. When I have time I plan to re-write the script as a small Clojure app. But for now, I am looking for a quick fix.

I suspect that after 3 or 4 days the script temporarily lost the database connection, and then was not able to continue. I'm trying to think about how to get around that possiblity. I'm thinking there might be something clever I can do with exceptions? Wrap it all in a try/catch block?

Any suggestions?

Lawrence Krubner | 01/20/13 at 8:12am Edit
Tutorial: How to assign prize money


(0) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.