Does rsync detect file corruption?

Daniel Carrera daniel.carrera at theingots.org
Fri May 22 11:43:31 GMT 2009


Hello,

Suppose that every day cron runs this:

rsync -a --times --delete $HOME /my/backups/dir/latest


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?

I am using rsync in a backup solution which could be summarized to:

cd /my/external/disk/backups
rsync -a --times --delete $HOME latest
cp -al latest $TODAYS_DATE


So, if a file never changes, I just end up with a lot of hard links 
pointing to the same block of data. That's meant to make the backup 
space efficient. But if that block of data gets corrupted, all my 
"backups" for that file are gone. And I'm concerned that if that 
happens, rsync will just merrily go along ignoring this file because the 
timestamp says that the file hasn't been modified so it doesn't need to 
be updated.

Thanks for the help.

Daniel.


More information about the rsync mailing list