On Sun, Oct 08, 2000 at 05:04:58PM -0700, Ian McNish wrote:
> > I think you can just say
> > 
> >   rsync -avz --include='*.gz' --include='*/' --exclude='*' \
> >     /tmp jumper::files
> > 
> > though this will also include directories that don't contain .gz files.
> > If you want to get rid of them you may have to experiment a bit more.
> 
> yes, but part of what confuses me is the line in the man page that
> states:
> 
>      o    --include "foo/" --include  "foo/bar.c"  --exclude  "*"
>           would  include  only foo/bar.c (the foo/ directory must
>           be explicitly included or it would be excluded  by  the
>           "*")
> 
> this contradicts the behaviour and the statement you made. 

It may look like a contradiction to you, but that would be because
you're making assumptions rather than reading it.

> also, the
> man page states:
> 
>      o    --exclude "/foo/*/bar" would exclude  any  file  called
>           bar two levels below a base directory called foo
> 
> which would support my assumption that the command:
> 
> % rsync -avz --include='*/*.gz' --exclude='*' /tmp/ jumper::files

Suppose you have /tmp/a/b/c.gz.  When rsync encounters the directory
/tmp/a, it finds that path does not match '*/*.gz' but it does match
'*'.  Therefore, that directory is excluded and the files below it are
never examined.  As the previous point says

>          (the foo/ DIRECTORY must be explicitly included or it would
>          be excluded by the "*")

-- 
Martin Pool

PGP signature

Reply via email to