Does rsync detect file corruption?

Paul Slootman paul+rsync at wurtel.net
Fri May 22 12:21:08 GMT 2009


On Fri 22 May 2009, Daniel Carrera wrote:
>
> In general, rsync will only update a file if it has been modified. Now,  
> imagine that one of the files becomes corrupted in the backup directory,  
>  but the timestamp hasn't changed. Will rsync detect this?

Not in the usual case.

You may want to consider adding -c (--checksum) to the options
periodically, as this tells rsync to checksum each file and use that as
a basis to determine whether to update a file or not, instead of modtime
and size. Note that this will probably slow rsync down considerably, as
it now needs to read each file on both ends of the transfer.


Paul


More information about the rsync mailing list