Does rsync detect file corruption?
Christian Hecht
mortaxx at gmx.de
Wed May 27 20:02:02 GMT 2009
Thank you Wayne for pointing me to these patches. I've never noticed
them before.
Am 24.05.2009 um 23:53 schrieb Wayne Davison:
> On Sun, May 24, 2009 at 06:32:40PM +0200, Christian Hecht wrote:
>> Such a tool i plan to write for Mac OS X. The first time it should
>> store checksums and mod times for all files to verify.
>
> There are various patches in the "patches" dir that deal with cached
> checksums in different ways:
>
> - checksum-reading.diff & checksum-updating.diff -- both of these
> use a
> special file in each dir to store the checksums, with the latter
> putting code into rsync to be able to update the file when copying
> the files (both have a perl script to build/update the files and
> check checksums against the file).
>
> - checksum-xattr.diff -- this has a script that puts checksums into an
> xattr field which rsync can access when it is using the --checksum
> option. The very latest version of this patch (in git) adds a --
> list
> and --check option to the script.
>
checksum-xattr.diff -This seems to be a good option for me but i'm a
not sure how to use it exactly.
- First i run the xsum script which generates all the checksums an
stores it in the xattrs
- Then i use rync which can compare the stored checksums with the
actual new generated checksum, right? I assume if the checksums are
different, there will be some message in log. But if a file has
changed meanwhile, the checksum also will be different. How can rsync
distinguish between these caes?
- To update the stored checksums, i have to use the xsum script again?
But if a file is corrupted, the checksum also will be updated?
Best regards
Christian
> - db.diff -- this is the start of some db-accessing code for rsync
> that
> can be used to store/access/check checksums (supports sqlite and
> mysql at present). This is the method I like the best, but the code
> is in an early state that needs more work.
>
> ..wayne..
More information about the rsync
mailing list