Wayne Davison wrote:
On Wed, Feb 25, 2004 at 02:32:47PM +1100, andrew wrote:

rsync -av --exclude "/user/profile/" --delete /home/user [EMAIL PROTECTED]:/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.

OK, I think I've worked out what the problem is.


Because the profile directory was never rsync'd (it was created independently on both the sender and the receiver) rsync didn't like it and deleted it every time.

So, I deleted profile/ on the receiver and rsync'd from the sender without the --exclude option. Now the profile directories on the sender and receiver are the same.

Subsequent calls to rsync, with the --exclude and --delete options, now behave as expected. profile/ is excluded from both the copy and the delete.

Is this the expected behaviour? Does rsync need to 'know' about a file before it can handle it correctly?

Thanks,
...andrew

--
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to