PDA

View Full Version : curl or wget and php script



Greslore
May 11th, 2009, 08:28 PM
Need some advice on this one.

I go to a URL via Firefox http://www.example.com/blah.php which runs "blah.php" which performs some db maintenance requiring no input from me. After about 5 minutes it simply returns saying "DONE!" to the web browser.

Now, I want to throw this into a nightly cron job, but I am having a heck of a time coming up with a way of running that blah.php and then capturing that "DONE!" to a txt file from a shell script. I believe I can use wget or curl to do this?

Schitso
May 11th, 2009, 08:32 PM
The page load doesn't time out in five minutes?

Greslore
May 11th, 2009, 08:36 PM
The page load doesn't time out in five minutes?

Nope - Apache is set to a higher threshold for time outs.

Schitso
May 11th, 2009, 08:42 PM
Check out the -O option for wget

pshah
May 14th, 2009, 07:36 PM
Try this command:

wget -O /path/to/txtfile "http://www.example.com/blah.php"

It should save the output in the text file.