Recursively navigate ftp site, collecting structure

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
masanford
Newbie
Posts: 3
Joined: Mon Apr 21, 2008 10:12 pm

Recursively navigate ftp site, collecting structure

Post by masanford » Mon Apr 21, 2008 10:19 pm

I am looking for any script that will recursively navigate ftp site, collecting directory and file structure. The ultimate purpose is to compare file listings from day to day, looking for new files of specific file type.

I need to start at a given point in the tree and gather all the structure from there to the bottom.

Any tips?

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

Post by Me_again » Mon Apr 21, 2008 11:01 pm

Have you looked at the Help for ftp? FTPGetDirList> may do what you want.

masanford
Newbie
Posts: 3
Joined: Mon Apr 21, 2008 10:12 pm

FTPGetDirList and subdirectories

Post by masanford » Wed Apr 23, 2008 6:48 pm

Will FTPGetDirList normally spider thriugh subdirectories as well -

Help file said "D obtains a full directory listing, including directories, subdirectories and their contents. " but I am only seeing ONE level .. is this true I would have to write further code to explore using the text file generated ...

is there a trick to getting FTPGetDirList to bring in subdirectories as well?

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 Apr 23, 2008 7:28 pm

I confirm your result, with the D option it's only showing the (names of the) subdirectories of the current directory, which isn't what I would expect from the Help example's "a listing of the entire contents of the server".

The L option does show more, but still not all the way down the tree.

I tested on my Apache server, not sure if it would be different on IIS.

If you really want to get into spidering then look at wget for windows which is a command line tool that can very conveniently be automated with Macro Scheduler. Be aware that spidering a site can be a bandwidth hog so be sure that what you are doing is OK with the webmaster.

masanford
Newbie
Posts: 3
Joined: Mon Apr 21, 2008 10:12 pm

Post by masanford » Thu Apr 24, 2008 12:10 am

Thanks - all excellent suggestions. In my research I stubled onWS-FTP Pro having a FIND tool that will do wha I want - just not as automated as I would like .. but it WILL let them find a specific file type added in the last day - and that is what they really wanted to do.

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

Post by Me_again » Thu Apr 24, 2008 12:32 am

Maybe a filesync program that will work across ftp servers and local pc's, and has scheduling, like syncback is what they are really looking for?

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