Preserving overwritten/deleted items

Wayne Davison wayned at
Mon Oct 3 19:24:14 GMT 2005

On Mon, Oct 03, 2005 at 10:54:20PM +1300, Grant Jacobs wrote:
> e.g. if you have a _file_ "tracker" on the source and a _directory_ 
> "tracker" on the destination, rsync will try delete the directory 
> regardless of what options you give it.

Of course -- it has to remove a directory that is in the way of a file
that it was told to copy.  If --delete or --force was not specified,
rsync will output an error if the directory is not empty.  If the
directory is empty, it's just removed (since an empty directory is not
considered necessary to backup on its own).  If --delete or --force WAS
specified, any removed contents are backed up, so it's all working as
it should.

> Likewise, if the source has a directory "silly-dir" and the
> destination has a file of the same name, rsync tries to clobber the
> file.

You seem to be trying to make that sound bad, but rsync needs to update
the file to its new status as a directory.

> In this case, the overwriting happens silently and the old file 
> is gone with no warning that its over-written anything or a backup 
> being made.

I don't know what version of rsync you're using, but it's always a good
idea to check the newest version before making such statements.  Rsync
creates a backup as it should in this case.  I'd recommend upgrading
(though that may be hard on OS X if you want to preserve Apple's mods).


More information about the rsync mailing list