in/exclude[=] and multiple sources

Steven Levine steve53 at
Fri Aug 19 11:35:24 MDT 2011

In <CE4BCF0B-F15A-4665-A5A7-DE3C51183A00 at>, on 08/19/11
   at 11:49 AM, Ken Gillett <emailist at> said:

Hi Ken,

>I still think the docs should explain you can use either form.

It does.  The first paragraph of the OPTIONS section states

       rsync uses the GNU long options package. Many of the  com-
       mand  line  options  have  two variants, one short and one
       long.  These are shown below, separated  by  commas.  Some
       options  only have a long variant.  The = for options that
       take a parameter  is  optional;  whitespace  can  be  used

>Are there ANY situations when either form will NOT work?

Baring defects, no.

>So one can think of rsync working on each source in turn and applying all
>the include and exclude options to each source directory as it works on
>that source. That's what I already surmised so thanks for the

As stated in the second paragraph of the FILTER RULES section

       As  the  list  of  files/directories to transfer is built,
       rsync checks each name to be transferred against the  list
       of  include/exclude patterns in turn, and the first match-
       ing pattern is acted on:  if it  is  an  exclude  pattern,
       then  that  file  is  skipped; if it is an include pattern
       then that filename is not skipped; if no matching  pattern
       is found, then the filename is not skipped.

Mentally, I replace references to file and filename to file/directory,
because that's really what is meant.

The man page contains a lot of information, so it's easy enough to miss
stuff even when one is looking for it specifically.


"Steven Levine" <steve53 at>  eCS/Warp/DIY etc.

More information about the rsync mailing list