Computing.Net > Forums > Windows 2000 > FTP script download recursive dirs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

FTP script download recursive dirs

Reply to Message Icon

Name: ikerstges
Date: February 28, 2007 at 02:23:03 Pacific
OS: Windows 2000
CPU/Ram: PIV/512Mb
Product: Dell/Optiplex GX240
Comment:

Hiall,

I need to download all files from a FTP location, INCLUDING any subdirectories. Currently, the folders are like:

ROOT
|
--Folder1
|
--Folder2

But tomorrow, it can be very well possible that a new folder gets created (Folder29 or so..). But there is no way to know if/when this is indeed the case, nor which name the new folder will have..

I can make a script that will download any files from ROOT, including the files from Folder1 and Folder2. I can run this script daily, but it would miss the files in any new folder.

Any suggestions?



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: February 28, 2007 at 10:30:24 Pacific
Reply:

You didn't specify the scripting language that you want to use, but this is extreamly easy to do in Perl.

================================================
#!perl

use Net::FTP::Recursive;

$ftp = Net::FTP::Recursive->new('www.mysite.com', Debug => 0);
$ftp->login('username', 'password');
$ftp->rget();
$ftp->quit;



0

Response Number 2
Name: ikerstges
Date: February 28, 2007 at 12:55:08 Pacific
Reply:

Hi FishMonger,

Thanks for your response! This looks extremely easy indeed! Wow..

I know I should study perl or others, but unfortunately, I don“t know any Perl at all.

I hope that my request can be realised just on the commandline in Windows 2000, with use of a plain ftp-scriptfile.


0

Response Number 3
Name: Mechanix2Go
Date: March 4, 2007 at 05:21:36 Pacific
Reply:

Try this:

::== T5.bat == gets all files from ftp site
@echo off
setLocal EnableDelayedExpansion

> #.ftp echo o golden-triangle.com
>> #.ftp echo username
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo ls -aR
>> #.ftp echo bye

ftp -s:#.ftp |findstr /b "./" > flog

> #.ftp echo o golden-triangle.com
>> #.ftp echo username
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo prompt

for /f "tokens=1 delims=:" %%A in (flog) do (
>> #.ftp echo mget %%A/*.*
)

>> #.ftp echo bye

ftp -s:#.ftp
::==


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 4
Name: Mechanix2Go
Date: March 18, 2007 at 02:47:12 Pacific
Reply:

No comment?


=====================================
If at first you don't succeed, you're about average.

M2



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: FTP script download recursive dirs

FTP server www.computing.net/answers/windows-2000/ftp-server/9256.html

Batch file to build a script www.computing.net/answers/windows-2000/batch-file-to-build-a-script/60897.html

ftp to a date created folder www.computing.net/answers/windows-2000/ftp-to-a-date-created-folder/48807.html