deleting remote dirs I no longer want to backup

Christophe LYON christophe.lyon at st.com
Mon Jan 23 12:06:03 GMT 2006


Wayne Davison wrote:
> On Fri, Jan 20, 2006 at 07:30:00PM +0100, Christophe LYON wrote:
>> My original command was:
>> rsync -aR --exclude=dirb --exclude-deleted dira dirb /tmp
> 
> I assumed the -R was unneeded because dira and dirb have no path
> information.  If that info was elided, then things may become much more
> complicated because you need to send the parent dir of the dir you want
> to delete (since rsync only deletes in directories that it sends).
> 

Wayne,

Thanks for your helpful replies.
However, I don't understand well you last comment (rsync only deletes in 
directories that it sends).

Consider that I want to transfer:
sparc/
	rel-1.0/
		file.c
		file.h
x86/	rel-1.0/
		file.c
		file.h

If I use: rsync -vaR */rel-1.0 /tmp/test-rsync/
I get:
sparc/
sparc/rel-1.0/
sparc/rel-1.0/file.c
sparc/rel-1.0/file.h
x86/
x86/rel-1.0/
x86/rel-1.0/file.c
x86/rel-1.0/file.h

Now, if I decide I want to remove the *.c files,
rsync -aRnv --exclude="*.c" --delete-excluded */rel-1.0 /tmp/test-rsync/
says:
deleting sparc/rel-1.0/file.c
deleting x86/rel-1.0/file.c

So, if I decide I want to remove rel-1.0 instead, I intended to use
rsync -aRnv --exclude="rel-1.0" --delete-excluded */rel-1.0 /tmp/test-rsync/

which does not work.

Why is the 2nd case different from the 1st one?

Christophe.


More information about the rsync mailing list