You can match for folders too if you want...
For simple patterns use --include GLOB-PATTERN
for complex patterns (many rules) you can set the rules in a file and use --include-from mypatterns.txt
If you want an example of how to match for a folder, you either need to specify exactly what it should or should not match (patterns need to be very spesific) - or you can just show me an example of a folder structure and point to one that you want the pattern to match, and I'll try to provide an example.
But generally, a folder match would look something along the lines of --include **foldername*/**
That should match any folder that has "foldername" anywhere in it's name (a partial match), and then transfer all files inside of it, including files in any of it's subfolders.
But there are many variations here depending on what exactly you need...
Now I just want to transfer folder AAA, BBB and CCC along with all the contents and subfolders in the folder AAA, BBB and CCC. How should I go around with this?
Note that it needs to be in a text file as the list is quite big.
Technically this matches any folder that ends in AAA (even if it has more at the start).
A direct match would be **/AAA/** , but that will not work for any folders that are in level 1 (in the root).
I don't know of a way to get it both ways (direct match but even on level 1).
Also @ncw can you try to include an option call include-only? Because I managed to solve my issue by excluding the folders that I don't need, but I wanted an option that downloads the only files required.
Just to check something basic, you aren't confusing --files-from with --include-from right? I've made that brainfart before too.
--files-from requires a full list of all files to include
--include-from contains rules in GLOB format, and is what would be appropriate to use there.
The logic for exclude and include works the same way. If include is not working as you'd expect and you aren't confusing it with --files-from then it's almost certainly a problem in the matching pattern you are specifying.