Delete But Don't Copy

Wayne Davison wayned at samba.org
Thu Sep 29 17:49:14 GMT 2005


On Thu, Sep 29, 2005 at 09:29:28AM -0400, Ryan Kather wrote:
> Is it possible to use RSYNC to only delete files that exist at the
> destination, but not the source.  I would like RSYNC to remove files
> that exist at the destination but do not exist at the source WITHOUT
> copying or creating any additional files.  

You can use these seemingly conflicting options:

    --existing --ignore-existing
    
This tells rsync to not update any files at all, allowing deletions to
happen normally.  (The first option would be more appropriately named
--ignore-non-existing, thus ignoring both existing and non-existing
files.)

..wayne..


More information about the rsync mailing list