December 13, 2006
wipe out directory tree through rsync
Posted by: admin : Category: Bits and Bytes, Shells
To wipe out a directory tree on a rsync server (an export) which you don’t have shell access to (but proper write access of course), just use this command:
# rsync -av –delete /tmp/clear.me/ rsync://some.rsync.host/some.export/
/tmp/clear.me is an example for a local but empty directory (empty as in ‘mkdir /tmp/clear.me).
Putting the slashes at the end of both local and remote path will allow you to sync the empty directory onto the server, effectively removing everything on the receiver side.