The Samba-Bugzilla – Bug 3229
Don't make backup file if destination file wasn't modified
Last modified: 2009-11-12 22:35:18 UTC
Enhancement request. I would like a modifier to the -b option that prevents
backup files from being created if the corresponding destination file was not
Just to be clear: rsync already avoids files that it didn't transfer. If you
aren't preserving timestamps (-t), rsync will update files that haven't really
changed (because their modified times differ). You can use the -c (--checksum)
option as one (expensive) way to avoid re-sending files that have not changed
their data, but do not match in modified time.
However, you may be suggesting that rsync be able to check if the updated file
that it just created was created a 100% match of the local file's data. In that
case, it should be possible to go ahead and skip the backup step (as long as
--inplace wasn't specified). We might not even need an option for this (though
I'd need to think about the ramifications of that).
I agree with this. The new option should be named --backup-ignore-existing and will prevent overwriting backup file if it already exist (from previous run(s) of rsync).
The post-transfer identical-data check is tracked in bug 5583.