Software to schedule FTP download and unzip?

SALvation

Senior member
Apr 10, 2001
964
0
0
What is the best software to automatically schedule a download from an FTP site, and then automatically unzip the downloaded file? I am working on a web application for real estate listings and the data is updated weekly on an FTP site. I'm looking for a solution so that I can automatically download the file weekly and unzip it so that I can schedule a database job to sync the data. A SQL job to copy the databases would be ideal, but the MLS company only offers their data via ZIP file on an FTP. Any ideas?
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
A batch file could easily accomplish this. What OS are we talking about?
 

SALvation

Senior member
Apr 10, 2001
964
0
0
Just Windows XP. The entire process I need to automate is:

- Download ZIP file from FTP weekly.
- Unzip ZIP file on local machine.
- Copy unzipped data (CSV file) from local machine to SQL database.
- Upload images from unzipped file to remote FTP server.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
1. Download 7-Zip, a free archive utility that supports command-line extract of ZIP files.

2. Build a script file to connect to your FTP site and download the ZIP file in question. Here's a guide that explains things. I made this sample script using Mozilla's website as an example:

open ftp.mozilla.org
anonymous
test@email.com
cd /pub/mozilla.org/firefox/releases/2.0/linux-i686/en-US
get firefox-2.0.tar.gz
quit

3. Determine the command line commands necessary to unzip the downloaded file via the command line. Type "C:\Program Files\7-Zip\7z.exe" in a command window to get the syntax. I used

"C:\Program Files\7-Zip\7z.exe" x C:\firefox-2.0.tar.gz -oC:\temp

to extract the downloaded file from step 2 to C:\temp.

4. Build a DTS package to import the extracted CSV in step 3 into your database. DTSRun.exe can execute this package via the command line.

5. Build another FTP script to upload the unzipped images to a remote FTP server.

6. Place the commands in steps 2-5 in a batch file.

7. Add the batch file to your scheduled tasks in Control Panel.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
I would use a scripting language. I think Dos is too limited for this, but Perl or VBScript should be able to handle this easily.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: nweaver
I would use a scripting language. I think Dos is too limited for this, but Perl or VBScript should be able to handle this easily.

A Windows batch file, along with a couple of utility programs I mentioned, can accomplish everything he's looking for. Why complicate matters with a scripting language?