RegExpr in ---exclude

tim.conway at tim.conway at
Mon Jun 24 09:33:49 EST 2002

I was waiting for someone more knowledgeable to respond, as the specific 
example you gave is covered and approved in the documentation, but i saw 
the "test" message sent less than 6 hours later, so I figure you must be 
under the gun.  From the man page:
   o    if the pattern contains a wildcard character  from  the
          set  *?[  then expression matching is applied using the
          shell  filename  matching  rules.  Otherwise  a  simple
          string match is used.
Your pattern fits this description, so it looks like you might have found 
a bug.  rsync does not support regular expressions, but rather a 
simplified set of matching rules.  There has been some talk about adding 
regex, but that's a big project.  What you show, though, is not a regular 
expression, but a shell pattern, which should work with rsync if you fix 
the syntax:
          --exclude=PATTERN       exclude files matching PATTERN

SunOS 5.7           Last change: 25 Jan 2002                    6

User Commands                                            rsync(1)

rsync --exclude "/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]"
rsync --exclude=/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]
and try again.  Frankly, I'm surprised you didn't get a usage message from 
that one.

Note that I removed the quotes.  They are not necessary, since you won't 
get any shell globbing of your pattern, because of the pattern being 
connected to "--exclude" by "=".  The quotes won't break anything, so you 
can leave them in.

Tim Conway
tim.conway at
303.682.4917 office, 3039210301 cell
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn, 
".\n" '
"There are some who call me.... Tim?"

"J.Strohschnitter" <svebu at>
Sent by: rsync-admin at
06/24/2002 02:30 AM

        To:     rsync at
        cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
        Subject:        RegExpr in ---exclude

Hi there,

is it possible to use regular expressions in the exclude-paramter of rsync 
For example:

rsync --exclude "/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]"

I've tried it, but it will take no effect.


                 FOR THE HEART OF THE SUN


To unsubscribe or change options:
Before posting, read:

More information about the rsync mailing list