RegExpr in ---exclude

tim.conway at philips.com tim.conway at philips.com
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)

Change 
rsync --exclude "/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]"
to
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 philips.com
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, 
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970), 
".\n" '
"There are some who call me.... Tim?"




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

 
        To:     rsync at lists.samba.org
        cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
        Subject:        RegExpr in ---exclude
        Classification: 



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.


-- 

SET THE CONTROLS 
                 FOR THE HEART OF THE SUN

Jens

-- 
To unsubscribe or change options: 
http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html







More information about the rsync mailing list