On Tue, Mar 20, 2001 at 03:21:54PM -0500, Magdalena Hewryk wrote:
> Hi,
> 
> I need to match the pattern:   profiles/[A-Z]{1,3}.html.
> 
> When I use the GNU grep I get the correct result:
> =================================================
> [root] # ls -ls * | /usr/local/bin/grep -v "\<[A-Z]\{1,3\}.html"
> 
>    2 -rw-r--r--   1 root     other          5 Mar 20 14:08 ABCD.html
>    2 -rw-r--r--   1 root     other          5 Mar 20 14:53 ABCDE.html
>    2 -rw-r--r--   1 root     other         10 Mar 20 11:32 T035.html
>    2 -rw-r--r--   1 root     other         10 Mar 20 11:31 T100.html
>    2 -rw-r--r--   1 root     other         15 Mar 20 11:31 not_found.html
> 
> Files like A.html, AB.html, ABC.html are not on the list and this is the way
> it should be.
> 
> When I try to apply this pattern to the rsync exclude file it doesn't work
> the way I expected.  Rsync copies all files from profiles to host2 instead
> of excluding A.html, AB.html, ABC.html.
> 
> profiles/T100.html
> listec/comp_[A-Zt2ig7].html
> profiles/[A-Z]{\1,3\}.html
> listec/[0-9]*
> tmp/
> 
> Thanks,
> Magda

Sorry, but that type of wildcard pattern isn't supported by the excludes.
See 'man rsync'.

It is possible to build your own complete list of files to copy and give
them all to rsync, by building a --include list and doing '--exclude *'
at the end.  Currently you need to also either have --include '*/' or
explicitly list all parent directories above the files you want included
or else the exclude '*' will exclude the whole directories.  There's been
talk of adding a --files-from option which would remove this last restriction,
and I even offered to implement it, but I'm still waiting for anybody to
give performance measurements (using rsync 2.3.2 which had an include
optimization that did something similar if there were no wildcards) to show
what the performance impact would be.

- Dave Dykstra

Reply via email to