FTP Get Files and Subdirectories Question

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

FTP Get Files and Subdirectories Question

Post by Rain » Tue Jun 05, 2007 2:42 pm

I'm not having any problem getting multiple files from a directory on my server. What I would like to know is if there is a way to download a folder, all the files and its subdirectories and the files in the subdirectories without having to list each directory separately?

I have tried this (personal info edited)

Code: Select all

FTPGetFile>ftp.MyDomain.com,Username,Password,21,C:\ backup\,/public_html/phpbb/,A
I was able to download all the files in the phpbb folder without using the wildcard but not the subdirectories.

Thanks for any help or suggestion.

Rain

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Jun 05, 2007 4:18 pm

I doubt you can do recursive retrieval directly with any FTP, although you could probably do a bunch of file listing and scripting and get there in the end. If you don't want to use a backup program (I use SyncBack which has a free version that can do FTP backups) you can use macroscheduler to automate wget which is a free command line network retrieval program.

wget is a windows port of a unix utility so it's very powerful but not user friendly. You can get it here, just download and expand the .zip that's the "current recommended download" at the top of the page.

Here's a quick attempt at a macro that does close to what you want:

Change Directory>c:\mydir
Run Program>c:\getw\wget ftp://username:[email protected]/web/subdir/ -r

It needs some fine tuning but what this will do is download the whole directory structure and files from /subdir onwards. As written it does create the WHOLE directory structure under c:\mydir so the first level is c:\mydir\mydomain.com and the next is c:\mydir\mydomain.com\web and then at last c:\mydir\mydomain.com\web\subdir which has files in. I think you can play with the options to fix that.

You can see all the options by wget --help at the command prompt, and google will turn up examples and help. Depending on what you are doing you might want the "-mirror" rather than the "-r" option.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed Jun 06, 2007 2:34 pm

Thank you for taking time to reply.

> I doubt you can do recursive retrieval directly with any FTP

With smart ftp all I have to do is drag and drop the main folder to download everything in that folder.

> wget is a windows port of a unix utility so it's very powerful but not user friendly.

I will give wget a try. Though, that is not the answer I was hoping for. :lol:

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Jun 06, 2007 3:50 pm

Rain wrote:> I doubt you can do recursive retrieval directly with any FTP

With smart ftp all I have to do is drag and drop the main folder to download everything in that folder.
Got me! Poor choice of words :lol: That's certainly "directly" from your POV, but there's all that gui functionality between you and hard core ftp so it's pretty indirect from my POV :D
I will give wget a try. Though, that is not the answer I was hoping for. :lol:
Well, remember the words of the Rolling Stones:

You can't always get what you want
And if you try sometime you find
You get what you need

:wink:

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts