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 wonder given a list of file paths, is it possible to loop each record (path) of the list and download corresponding files using ScriptFTP? Here, the number of paths can be tens of thousands.

A prompt reply will be highly appreciated!
You can fill a list with your paths and then use the FOREACH sentence to download the corresponding files of each path. For example:
Code: Select all# Note that each item in the list is separated by the | character $list_of_paths="/mydir/mysubdir|/mydir2/subdir2|/mydir3/aaaa" FOREACH $path IN $list_of_paths  GETFILE($path) END FOREACH  
Thank you very much for the prompt reply. But my problem is the number of file paths can be tens of thousands, will that be any problem?
I tried your code, it worked beautifully. Thanks heaps!
I used the code provided by you and was trying to FTP download
hundreds files from sec website. But the script program me stopped
automatically which prompted connection closed. What was the problem
do you think? Could you help me with this?
Some servers close the client connection from time to time, specially when the client ScriptFTP is doing some heavy load.

To fix this you have to use the GOTO command to jump to the top of the script, reconnect and continue trasferring files. There are many examples of this in the documentation section of the website. The help topic is this one: http://www.scriptftp.com/reference.php?go=topic310
Thank you for the prompt reply. Regarding the disconnection problem, I will read the manual and find the corresponding part.

Indeed, my client ScriptFTP is doing heavy downloading (I need to download about 130,000 files). I tried to do them in 13 batches, but failed. Then I tried 1000 file paths one time, but errors were prompted. 500 files downloading each time is ok though.

Now I only download 500 files for each time and disconnect; connect again for another 500 loops. Basiclly copy and past the code (you wrote me below) for 130,000/500=260 times. For every 500 files downloading, it needs about 2 hour which in total about 22 days if everything goes smoothly. Is there any shortcut to save the time?
Code: Select all$list_of_paths="/mydir/mysubdir|/mydir2/subdir2|/mydir3/aaaa" FORACH $path in $list_of_paths  GETFILE($path) END FOREACH
Many thanks!
Thanks for the feedback. You can launch multiple instances of ScriptFTP (many script running at the same time). This should save you some time.