rsync with --exclude files

Leaw, Chern Jian chern.jian.leaw at
Thu Jul 25 03:08:02 EST 2002


I'm trying to exclude some files & directories from a filesystem which I
would like to copy to a different site. I did:

# rsync -avz --exclude-file=/fs21/tmp/perl_scripts/exclude.txt

where file /fs21/tmp/perl_scripts/exclude.txt  contains the following
directories and files to be excluded from  /fs22/a/circuit_design    :
# cat /fs21/tmp/perl_scripts/exclude.txt

I'm invoking rsync from a machine named to transfer
files/directories in /fs22/a/circuit_design to
However, it still copies all files or directories in the filesystem
/fs22/a/circuit_design  to It should
not include the files/directories mentioned in the
/fs21/tmp/perl_scripts/exclude.txt file.

I've tried with   the following for excluding just 1 file or directory and
it works:
# rsync -avz --exclude=/fs22/a/circuit_design/file1   /fs22/a/circuit_design

It does not however work when I did the following for excluding >1
rsync -avz --exclude=/fs22/a/circuit_design/file1
--exclude=/fs22/a/circuit_design/file2   /fs22/a/circuit_design

I was wondering if this should be the way to rsync a filesystem, excluding
some files/ directories?  

Please help.


More information about the rsync mailing list