Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hiall,
I need to download all files from a FTP location, INCLUDING any subdirectories. Currently, the folders are like:
ROOT
|
--Folder1
|
--Folder2But 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?

You didn't specify the scripting language that you want to use, but this is extreamly easy to do in Perl.
================================================
#!perluse Net::FTP::Recursive;
$ftp = Net::FTP::Recursive->new('www.mysite.com', Debug => 0);
$ftp->login('username', 'password');
$ftp->rget();
$ftp->quit;

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.

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 byeftp -s:#.ftp |findstr /b "./" > flog
> #.ftp echo o golden-triangle.com
>> #.ftp echo username
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo promptfor /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

No comment?
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

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