Home Explore Blog CI



man-pages

81th chunk of `rsync.man`
45c771e311cf54181697b4ede50f5c0de5abcd5454b435c60000000100001028
 merge (.) or a dir‐merge (:) filter rule (as introduced  in  the  FILTER
       RULES section above).

       There are two kinds of merged files -- single‐instance (’.’) and per‐di‐
       rectory  (’:’).   A single‐instance merge file is read one time, and its
       rules are incorporated into the filter list in  the  place  of  the  "."
       rule.   For  per‐directory  merge files, rsync will scan every directory
       that it traverses for the named file, merging its contents when the file
       exists into the current list of inherited  rules.   These  per‐directory
       rule files must be created on the sending side because it is the sending
       side  that  is being scanned for the available files to transfer.  These
       rule files may also need to be transferred to the receiving side if  you
       want  them  to  affect  what  files don’t get deleted (see PER‐DIRECTORY
       RULES AND DELETE below).

       Some examples:

           merge /etc/rsync/default.rules
           . /etc/rsync/default.rules
           dir‐merge .per‐dir‐filter
           dir‐merge,n‐ .non‐inherited‐per‐dir‐excludes
           :n‐ .non‐inherited‐per‐dir‐excludes

       The following modifiers are accepted after a merge or dir‐merge rule:

       o      A - specifies that the file should consist of only  exclude  pat‐
              terns, with no other rule‐parsing except for in‐file comments.

       o      A  +  specifies that the file should consist of only include pat‐
              terns, with no other rule‐parsing except for in‐file comments.

       o      A C is a way to specify that the file should be read  in  a  CVS‐
              compatible manner.  This turns on ’n’, ’w’, and ’-’, but also al‐
              lows the list‐clearing token (!) to be specified.  If no filename
              is provided, ".cvsignore" is assumed.

       o      A  e  will  exclude  the  merge‐file name from the transfer; e.g.
              "dir‐merge,e .rules" is like "dir‐merge .rules" and "- .rules".

       o      An n specifies that the rules are not  inherited  by  subdirecto‐
              ries.

       o      A w specifies that the rules are word‐split on whitespace instead
              of  the  normal  line‐splitting.   This  also turns off comments.
              Note: the space that  separates  the  prefix  from  the  rule  is
              treated  specially,  so "- foo + bar" is parsed as two rules (as‐
              suming that prefix‐parsing wasn’t also disabled).

       o      You may also specify any of the modifiers  for  the  "+"  or  "-"
              rules  (above)  in  order to have the rules that are read in from
              the file default to having that modifier set (except  for  the  !
              modifier,  which  would  not be useful).  For instance, "merge,-/
              .excl" would treat the contents of  .excl  as  absolute‐path  ex‐
              cludes,  while  "dir‐merge,s .filt" and ":sC" would each make all
              their per‐directory rules apply only on the sending side.  If the
              merge rule specifies sides to affect (via the s or r modifier  or
              both),  then  the rules in the file must not specify sides (via a
              modifier or a rule prefix such as hide).

       Per‐directory rules are inherited in all subdirectories of the directory
       where the merge‐file was found unless the ’n’ modifier was  used.   Each
       subdirectory’s  rules  are prefixed to the inherited per‐directory rules
       from its parents, which gives the newest rules a  higher  priority  than
       the  inherited rules.  The entire set of dir‐merge rules are grouped to‐
       gether in the spot where the merge‐file was specified, so it is possible
       to override dir‐merge rules via a rule that got specified earlier in the
       list of global rules.  When the list‐clearing rule ("!") is read from  a
       per‐directory  file,  it only clears the inherited rules for the

Title: Rsync Merge-File Filter Rules: Details and Modifiers
Summary
This section elaborates on rsync's merge-file filter rules, covering single-instance and per-directory merge files. It explains modifiers for merge rules: '-' for exclude-only, '+' for include-only, 'C' for CVS-compatible, 'e' to exclude the merge-file name, 'n' for non-inherited, and 'w' for whitespace-split rules. It also allows applying '+' or '-' modifiers to the merged rules. Per-directory rules are inherited unless 'n' is used, with newer rules having higher priority.