deleting files on server side

Paul Slootman paul at debian.org
Wed Aug 11 07:31:15 GMT 2004


On Tue 03 Aug 2004, Fabiano Reis wrote:
> 
> Do someone know how can I delete files on a rsync server by using a rsync 
> client without using SSH/RSH? 

rsync an empty directory to it, and use the --delete option?

> Doing a "rsync -avz --stats --port=874 /export/home/user/* 
> destinationhost::TEST" I´m copying files from /export/home/user/* to the 
> 'path' of destinationhost. TEST module have the ‘path’ directive set to 
> ‘/home/user’. 

Don't use /export/home/user/* , leave the recursion to rsync, i.e. use
/export/home/user/

> My doubt is how can I delete all files/directory over /home/user/* before 
> copying the source files to it ? 

Why? If you use rsync's --delete option, it will delete any files that
don't exist on the sender; files that exist on both sides will benefit
from rsync's algorithm and speed up the transfer.


Paul Slootman


More information about the rsync mailing list