Home Explore Blog CI



man-pages

80th chunk of `rsync.man`
7f7cbac743eecae0bc27ceac65d5885b5666a43f53e3225f0000000100000ff0
 nothing else

       o      Options -f’+ foo/’ -f’+ foo/bar.c’ -f’- *’ would include only the
              foo directory and foo/bar.c (the foo directory must be explicitly
              included or it would be excluded by the "- *")

   FILTER RULE MODIFIERS
       The following modifiers are accepted after an include (+) or exclude (-)
       rule:

       o      A  /  specifies  that  the include/exclude rule should be matched
              against the absolute pathname of the current item.  For  example,
              -f’-/ /etc/passwd’  would  exclude  the  passwd file any time the
              transfer was sending files from the  "/etc"  directory,  and  "-/
              subdir/foo"  would always exclude "foo" when it is in a dir named
              "subdir", even if "foo" is at the root of the current transfer.

       o      A ! specifies that the include/exclude should take effect if  the
              pattern  fails  to  match.  For instance, -f’-! */’ would exclude
              all non‐directories.

       o      A C is used to indicate that all  the  global  CVS‐exclude  rules
              should  be  inserted  as  excludes  in place of the "-C".  No arg
              should follow.

       o      An s is used to indicate that the rule  applies  to  the  sending
              side.   When  a  rule  affects  the sending side, it affects what
              files are put into the sender’s file list.  The default is for  a
              rule to affect both sides unless --delete‐excluded was specified,
              in  which  case  default rules become sender‐side only.  See also
              the hide (H) and show (S) rules, which are an  alternate  way  to
              specify sending‐side includes/excludes.

       o      An  r  is used to indicate that the rule applies to the receiving
              side.  When a rule affects the receiving side, it prevents  files
              from  being deleted.  See the s modifier for more info.  See also
              the protect (P) and risk (R) rules, which are an alternate way to
              specify receiver‐side includes/excludes.

       o      A p indicates that a rule is perishable, meaning that it  is  ig‐
              nored  in  directories that are being deleted.  For instance, the
              --cvs‐exclude (-C) option’s default  rules  that  exclude  things
              like  "CVS" and "*.o" are marked as perishable, and will not pre‐
              vent a directory that  was  removed  on  the  source  from  being
              deleted on the destination.

       o      An  x  indicates  that  a  rule  affects  xattr  names  in  xattr
              copy/delete  operations  (and  is  thus  ignored  when   matching
              file/dir names).  If no xattr‐matching rules are specified, a de‐
              fault xattr filtering rule is used (see the --xattrs option).

   MERGE‐FILE FILTER RULES
       You  can merge whole files into your filter rules by specifying either a
       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

Title: Rsync Filter Rule Modifiers and Merge-File Rules
Summary
The section discusses filter rule modifiers in rsync, including 'C' for CVS-exclude rules, 's' and 'r' for sender/receiver side application, 'p' for perishable rules ignored in deleted directories, and 'x' for xattr name matching. It further explains merge-file filter rules, including single-instance and per-directory merge files, which incorporate rules from external files. Per-directory merge files are scanned in each traversed directory on the sending side, affecting file transfers and deletions.