deleting remote dirs I no longer want to backup
christophe.lyon at st.com
Fri Jan 20 14:33:06 GMT 2006
I have been using rsync to copy multiple dirs, eg:
rsync -aR dira dirb /tmp
Now, I no longer want to copy dirb, and I want it to be removed on the
remote side, and I cannot figure how to achieve this.
rsync -aR --exclude=dirb --exclude-deleted dira dirb /tmp
but this has no effect.
I have searched for similar posts, and found:
What is exactly meant by "Rsync only deletes inside directories
that it sends" ? I mean, in the command I used, I provide dirb in the
list of dirs to be copied, so "send" mean really send over the wire?
I have tried what is suggested (ie put dira and dirb into test-rsync/
and send test-rsync):
rsync -avn --exclude=dirb --delete-excluded test-rsync/ /tmp
but in this particular case, it tries to remove many things in /tmp
which is obviously populated with many files ;-)
I suppose there is an 'obvious' to do what I want, but how?
More information about the rsync