On Fri, Oct 06, 2000 at 07:05:22PM -0700, Ian McNish wrote:
> 
> 
> i have a directory containing a number of directories with each
> directory containing one or two files i need to transfer and a number
> of files i don't want to transfer. all of the files i want to transfer
> are gzipped, and i would like to keep the directory structure. a
> example of the structure is:
[...]
> to accomplish this i cd to /tmp, put the output of a find command, to
> find *.gz, into a temp file and issue the command:
> 
> % rsync -avz --include-from=/tmp/.rsync.files
> --exclude="*" jumper::files

As the manual says

       If  you  end an exclude list with --exclude '*', note that
       since the algorithm is applied recursively that unless you
       explicitly include parent directories of files you want to
       include  then  the  algorithm  will  stop  at  the  parent
       directories  and  never  see  the  files  below  them.  To
       include all directories, use  --include  '*/'  before  the
       --exclude '*'.

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.

Cheers,
-- 
Martin Pool, Linuxcare, Inc.
+61 2 6262 8990
[EMAIL PROTECTED], http://www.linuxcare.com/
Linuxcare. Support for the revolution.

PGP signature

Reply via email to