Sometimes I don’t want a whole folder, just the twenty files I picked. Excluding everything else with filter rules gets tedious fast. rsync can take the list itself.
rsync -a --files-from=list.txt /home/me/ backup:/backup/
Every line in list.txt is a path relative to the source directory. A line like docs/notes.txt ends up as /backup/docs/notes.txt, so the folder structure comes along. A name with a trailing slash also sends the immediate contents of that directory. If the file is -, rsync reads the list from standard input:
find . -name '*.md' -print0 | rsync -a --from0 --files-from=- ./ backup:/notes/
--from0 means the names end with a null character instead of a newline, which keeps names with spaces or odd characters safe.
One caveat from the manual: -a does not imply -r when you use --files-from. If you want the contents of a listed folder all the way down, add -r yourself. Listing single files also doesn’t make their unlisted siblings eligible for deletion at the destination.
The manual also says that --dirs is implied by --files-from, and that the side effects of --files-from are not positional on the command line, so it does not matter where you put it. With --no-implied-dirs, the attributes of the implied directories from the source names are not included in the transfer.
Further reading: rsync manual