rsync delete

Jesse Thompson jesset at gmail.com
Sun Nov 4 21:50:53 GMT 2007


Hello :)

I am trying to build a backup system based upon Rsync, and I have a question
about it's deleting features.

I want to be able to use rsync to delete and remove a directory from the
remote server, similar to "rm -Rf directory"

The closest I seem to be able to get is the following progression:

# rm -Rf directory (nuke local directory)
# mkdir directory (recreat as empty directory)
# rsync -mr --delete 'directory' remote::volume/directory

( woops, now remote::volume/directory continues to exist and contains an
empty remote::volume/directory/directory :P )

# rsync -mr --delete 'directory' remote::volume

(says "no files to transfer", and nothing happens. @#$%)

# touch directory/dummy_file
# rsync -mr --delete 'directory' remote::volume/directory

( vroom! now the contents of remote::volume/directory are being cleaned out.
unfortunately remote::volume/directory/dummy_file will remain for all
eternity.. )


What would be the closest approximation to something like this?

# rsync -r --just-nuke-the-target remote::volume/directory

Is it something that can be done with rsync?

Thanks!

- - Jesse Thompson
Webformix, Bend OR
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list