Home Explore Blog CI



man-pages

45th chunk of `rsync.man`
3330058851fe8dba75e47d949f2411e5f205feda4eb70cf80000000100001000
 /.rsync‐filter’

              This tells rsync to look for  per‐directory  .rsync‐filter  files
              that  have  been  sprinkled  through  the hierarchy and use their
              rules to filter the files in the transfer.  If -F is repeated, it
              is a shorthand for this rule:

                  ‐‐filter=’exclude .rsync‐filter’

              This filters out the  .rsync‐filter  files  themselves  from  the
              transfer.

              See  the  FILTER  RULES  section  for detailed information on how
              these options work.

       --exclude=PATTERN
              This option is a simplified form  of  the  --filter  option  that
              specifies  an exclude rule and does not allow the full rule‐pars‐
              ing syntax of normal filter rules.  This is equivalent to  speci‐
              fying -f’- PATTERN’.

              See the FILTER RULES section for detailed information on this op‐
              tion.

       --exclude‐from=FILE
              This  option is related to the --exclude option, but it specifies
              a FILE that contains exclude  patterns  (one  per  line).   Blank
              lines  in  the  file are ignored, as are whole‐line comments that
              start with ’;’ or ’#’ (filename rules that contain those  charac‐
              ters are unaffected).

              If  a  line begins with "- " (dash, space) or "+ " (plus, space),
              then the type of rule is being explicitly specified as an exclude
              or an include (respectively).  Any rules without  such  a  prefix
              are taken to be an exclude.

              If a line consists of just "!", then the current filter rules are
              cleared before adding any further rules.

              If FILE is ’-’, the list will be read from standard input.

       --include=PATTERN
              This  option  is  a  simplified  form of the --filter option that
              specifies an include rule and does not allow the full  rule‐pars‐
              ing  syntax of normal filter rules.  This is equivalent to speci‐
              fying -f’+ PATTERN’.

              See the FILTER RULES section for detailed information on this op‐
              tion.

       --include‐from=FILE
              This option is related to the --include option, but it  specifies
              a  FILE  that  contains  include  patterns (one per line).  Blank
              lines in the file are ignored, as are  whole‐line  comments  that
              start  with ’;’ or ’#’ (filename rules that contain those charac‐
              ters are unaffected).

              If a line begins with "- " (dash, space) or "+ "  (plus,  space),
              then the type of rule is being explicitly specified as an exclude
              or  an  include  (respectively).  Any rules without such a prefix
              are taken to be an include.

              If a line consists of just "!", then the current filter rules are
              cleared before adding any further rules.

              If FILE is ’-’, the list will be read from standard input.

       --files‐from=FILE
              Using this option allows you to specify the exact list  of  files
              to  transfer (as read from the specified FILE or ’-’ for standard
              input).  It also tweaks the default behavior  of  rsync  to  make
              transferring just the specified files and directories easier:

              o      The --relative (-R) option is implied, which preserves the
                     path  information  that  is specified for each item in the
                     file (use --no‐relative or --no‐R if you want to turn that
                     off).

              o      The --dirs (-d) option is implied, which will  create  di‐
                     rectories  specified in the list on the destination rather
                     than noisily skipping them (use --no‐dirs or --no‐d if you
                 

Title: Rsync Filtering Options: --exclude-from, --include, --include-from, --files-from
Summary
This section continues detailing rsync's filtering options, explaining --exclude-from and --include-from, which read exclude/include patterns from a file. It clarifies the format of these files, including support for comments, explicit include/exclude prefixes, and clearing the filter rules with '!'. It introduces the --include option as a simplified version of --filter for includes. Lastly, it describes --files-from, which allows specifying a precise list of files to transfer from a file or standard input, implicitly enabling --relative and --dirs unless explicitly disabled.