Hi, I am experiencing a problem when using rsync (2.6.0) and I was after some clarification. I wish to sync two directories except for a specified sub-directory that exists in both the sending and receiving directories. So, rsync -av --exclude "/user/profile/" --delete /home/user user@receiver:/home This works as I expect, sender:/home/user/profile/ is not copied, except that receiver:/home/user/profile/ is deleted. From the manual: --delete This tells rsync to delete any files on the receiving side that aren't on the sending side. <fair enough> Files that are excluded from transfer are excluded from being deleted unless you use --delete-excluded. <!> The directory sender:/home/user/profile/ IS successfully excluded from the transfer and yet receiver:/home/user/profile/ still gets deleted. Is my understanding that, if excluded from transfer, a directory should not get deleted from the receiver correct? Or, have I screwed up my command somewhere? Many thanks, ...andrew
On Wed, Feb 25, 2004 at 02:32:47PM +1100, andrew wrote:> rsync -av --exclude "/user/profile/" --delete /home/user user@receiver:/home > > This works as I expect, sender:/home/user/profile/ is not copied, except > that receiver:/home/user/profile/ is deleted.I can't duplicate this. If I make /home/user/profile on the receiver a file (instead of a directory) it will vanish (because the trailing slash on the exclude tells rsync only to exclude a directory by that name), but if it's a directory, it remains unaffected. ..wayne..
On Wed 25 Feb 2004, andrew wrote:> > rsync -av --exclude "/user/profile/" --delete /home/user user@receiver:/home > > This works as I expect, sender:/home/user/profile/ is not copied, except > that receiver:/home/user/profile/ is deleted.Hmm, wouldn't the exclude need to be "/profile", as the exclude patterns starting with / are anchored at the top of the source tree, ie. /home/user ? Or am I confused about the exclude patterns again :) Paul Slootman