Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

  1. Include subdirs dir11 and dir12 at level 1.
  2. Exclude the rest at level 1.
  3. Within dir11 and dir12, include all files *.cc, *.txt in the subtrees.
  4. Within dir11 and dir12, exclude all other files.
  5. Within dir11 and dir12, 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

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy