Page 1 of 1

Transfer files from one FTP to another FTP

Posted: 2023-11-30 22:47
by fortega
I need to download all the content from one FTP to another.
It consists of many folders, each of them having multiple subfolders. Inside each folder, there are at least 10 files, but always 3 files and a folder, let's call them '1.jpg, 2.jpg, 3.html,' and the folder 'armoni,' that are repeated in all folders and subfolders.
I need to be able to download the entire FTP and transfer it to another FTP without taking those 3 files and the 'armoni' folder. At the same time or in another step, I need to place in each folder and subfolder another 3 files, which would be '4.jpg, 5.jpg, 6.html,' and the 'armoni' folder.
I have to do this once a week.
I know it's difficult to explain, but can you think of a way to do it? Thanks.

Re: Transfer files from one FTP to another FTP

Posted: 2023-12-01 08:24
by botg
You might be able to use FileZilla Pro CLI for this, though you would still need to create a program or script that invokes the tool and parses its output. FileZilla Pro CLI can be set configured to output JSON snippets, so parsing its output should be simple.

What your script would do, invoking FileZilla Pro CLI for each operation: List the contents of the root directory on the source server. Parse the listing, ignore the undesired items. Download each file and upload it to the target server. For each subdirectory, just call the script recursively. At the end, upload any extra files to the target server.