... a/foo/bar/baz.txt b/bar/asdf.jpg c/qwerty/bletch.txt ...and I wanted to rsync only the .txt files to my local machine:
a/foo/bar/baz.txt c/qwerty/bletch.txtThere are lots of search results for the topic, but most didn't work right -- rsync -vv kept telling me that my --exclude="*" rule was excluding everything. This post gives the correct details. You need to explicitly include the directories you want, or just --include='*/', then --include='*.txt', then --exclude='*'. You may end up with a bunch of empty directories; I haven't figured out how to efficiently avoid that.