Does rsync detect file corruption?

Daniel Carrera daniel.carrera at theingots.org
Sun May 24 16:01:34 GMT 2009


Jamie Lokier wrote:
> Daniel Carrera wrote:
>> But there is no way to distinguish between file corruption and a 
>> legitimate change. All you can do is keep old backups for a few days or 
>> weeks and hope that you detect the file corruption before the backup 
>> rotation deletes all the good copies.
> 
> I'm under the impression ZFS (Solaris) and BTRFS (Linux) allow a
> checksum to be stored with the file data, so if the data changes due
> to disk corruption or glitches in the I/O cabling, that will be detected.

Thinking a little more about this problem, there is one possible 
solution: Store a checksum and mod time when the file is backed up. If 
later on, the file's checksum is different but the modification time has 
not changed, it is safe to assume that the file is corrupt. So we can 
distinguish between legitimate edits an accidental corruption.

Daniel.


More information about the rsync mailing list