rsync not overwriting files on destination

Eric Chen echen at
Wed Jun 4 07:13:48 EST 2003


I am rsyncing from my source server A to a destination server B.
A/vol1 contains two files syslog.txt and syslog.bak
B/vol1 contains five files syslog.txt, syslog.bak, initlog.txt,
internal.txt, and internal.bak.

I want to preserve the 5 files on B/vol1 when I do rsync from A to B.

Here is the command I use:
rsync -av --delete --exclude-from=EXCLUDEFILE A/ B

I've tried the option "--exclude-from=EXCLUDEFILE" and I put the paths of
those 5 files (B/vol1/FILEPATH) into that EXCLUDEFILE. However, the two
files on A, syslog.txt and syslog.bak are still being rsync'ed to B and the
other 3 files on B (initlog.txt, internal.txt, and internal.bak) are being

I've read the manpage and it says that "--exclude-from" excludes PATTERNs
that are listed in file.
Does this mean I can't exclude the exact file with the pathname?

I've tried doing rsync with the options
"--exclude=syslog.txt --exclude=syslog.bak --exclude=initlog.txt --exclude=i
nternal.txt --exclude=internal.bak", but this also excludes any occurences
of those files that might not be under A/vol1, and this is something I don't

I just want to be able to preserve those 5 files under B/vol1.

Any help would be appreciated.


More information about the rsync mailing list