Forum Moderators: phranque

Message Too Old, No Replies

How to pull a file and save it via cronjob

         

madmatt69

6:27 pm on Mar 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heya everyone,

I think this is relatively easy but I'm not quite sure how to do it.

There's a datafeed I'd like to download and save on my server every 30 minutes. I can setup the cronjob via cpanel no problem, but I'm unsure of what command I need to tell it to download and save the datafeed.

Some thing like "Copy [site.com...] datafeed.txt"

Any ideas on the correct way to do this?

One option I was thinking of is making a php script that downloads the file, and then the cronjob calls that script every 30 minutes or something. Is that the better way to do it?

Thanks for the help!

Discovery

7:11 am on Mar 20, 2007 (gmt 0)

10+ Year Member



this will use to download the file
wget [site.com...]

use this in ur contab file

5 * * * * wget [site.com...]

please make the necessary changes, how frequently u have to save the file. Remember first time it will save datafeed.asp and next time datafeed.asp.1, datafeed.asp.2 & so on