my rsync command looks like this:
rsync --update -rav --filter="merge $HOME/mergefilter.txt" ~/ (remote_destination):~/
My mergefilter.txt file looks like this:
+ /directory_1/***
+ /directory_2/***
+ /directory_etc/***
- /**
The rsync
command works great and updates everything in the specified directory trees. However, I am looking to add some specifics to it. I am not sure of the necessary syntax, but for one of my directory trees, I want to only include certain files. For example, imagine my mergefilter.txt working like this:
+ /directory_1/***
+ /directory_2/*** --include="*.c++" --include="*.h"
+ /directory_etc/***
- /**
So that when syncing the directory_2 directory tree (and its subdirectories), only .c++ and .h files are updated.
I have viewed other stackexchange pages asking similar questions, but none of them demonstrate how to use include
when using a filter file. What would be the correct syntax here?