Does rsync detect file corruption?
Matthias Schniedermeyer
ms at citd.de
Fri May 22 13:57:37 GMT 2009
On 22.05.2009 13:43, Daniel Carrera wrote:
> 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.
Exactly.
But you can (periodically) add "-c", then rsync while checksum the whole
content of all files.
But IF you have (or suspect) such type of corrution, you have have an
even greater problem: Your hardware is crap.
Bis denn
--
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.
More information about the rsync
mailing list