I mean to rsync some files of a subdirectory tree at dir1.
I am using
[dir1]$ rsync --itemize-changes --recursive --update --times --include-from="rsync_include.dat" --exclude="*" --dry-run ./ remote:~/dir1/The rules are as follow, in this order.
- Include subdirs
dir11anddir12at level 1. - Exclude the rest at level 1.
- Within
dir11anddir12, include all files*.cc,*.txtin the subtrees. - Within
dir11anddir12, exclude all other files. - Within
dir11anddir12, include some specific subtrees (at possibly various levels), with all their contents.
I am not hitting the nail in the head with the proper combinations of single, double and triple asterisks, plus/minus signs, trailing backslashes, and rules order in my rsync_include.dat.
What would the correct contents be?
Among all I tried, I am posting below the current state of my rsync_include.dat.
Among others, it did not match file classes/src/TEST/classes_test.cc, which had a later date in ./ than in remote:~/dir1/, and therefore I want it to be rsynced.
In this case, I am looking for a pattern that would match that file without me having to enter + classes/src/TEST/*.cc, since there might be other *.cc at various depths and branches.
+ classes/
+ sanitizers/
- ***/.cproject
+ **/*.cc
+ ***/*.cc
+ **/*.cpp
+ **/*.dat
- */
- **/ 2 Reset to default