ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
I only need certain images from certain directories on a remote server but it is important to retain the remote server's directory structure for the images I do copy.

For example:
The remote server has the these files...
/images/cat1/image01.png
/images/cat1/image02.png
/images/cat1/image03.png
/images/cat2/image01.png
/images/cat2/image02.png
/images/cat2/image03.png
...and I only want a single file from each cat1 and cat2 but also need the directory structure intact, how would this be scripted?

Because I'm actually dealing with many thousands of files, simply using GETFILE and manually creating and sorting the directory is just not possible, and SYNC would not work because the remote server has far too many files for me to process or store.
You need to find a combination of SYNC and ADDEXCLUSION. Note that SYNC will replicate the directory structure of the FTP server. Something like:
FTP Script
  1. ADDEXCLUSION(REMOTE,"/thisdirectoryno/")
  2. ADDEXCLUSION(REMOTE,"/thisotherdirectoryno/")
  3. SYNC("C:\downloaded_files","/",DOWNLOAD,SUBDIRS,"*.png")