rsync not overwriting files on destination

jw schultz jw at
Wed Jun 4 07:27:30 EST 2003

On Tue, Jun 03, 2003 at 02:13:48PM -0700, Eric Chen wrote:
> Hi,
> 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

The patterns are tree relative.  A and B are outside the tree.
Think of the pattern as having to match regardless of
whether applied to source or destination.

> 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
> deleted.
> 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
> want.
> I just want to be able to preserve those 5 files under B/vol1.
> Any help would be appreciated.
> Thanks,
> ~Eric
> -- 
> To unsubscribe or change options:
> Before posting, read:

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list