Verifying backups

Kevin Korb
Thu, 01 Oct 2015 07:55:50 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yes, when it comes to local copies cp is significantly faster than
rsync.  Without --link-dest there isn't much advantage to using rsync
for backups.  The only thing you get beyond cp -au is --delete.

Also, when it comes to static data like media files I like to keep an
md5 file around with checksums for all the files.  That way I can
easily verify the files later on either the primary or backup storage
and more importantly if they differ I can tell which one is correct.

The cfv utility is great for file verifying.  The -n option on it
tells it to rename incorrect files.  Then you can just do a simple
rsync pass to delete the incorrectly named files and put back the now
missing files.

On 10/01/2015 01:53 AM, Perry Hutchison wrote:
> "Ronald F. Guilmette" <rfg at tristatelogic.com> wrote:
>
>> P.S.  I really do hope that I can get this to work with rsync. I
>> do prefer not reinventing the wheel, but it is starting to seem
>> simpler to me if I were to just write a Perl script that would
>> walk two directory hierarchies, in parallel, and just repeatedly
>> invoke the cmp command on all of the regular files found
>> therein.
>
> Just because rsync is an awesome hammer, it does not necessarily
> follow that every problem involving backups closely resembles a
> nail :)
>
> Since your source and backup are both local, I suspect using rsync
> as a comparison tool is overkill.  (It may even be overkill for
> making the backups in the first place.)  Had you considered "diff
> -q -r"?
>
> $ mkdir one two $ echo hello > one/hello $ ln one/hello two/hello $
> echo different0 > one/foo $ echo different1 > two/foo $ diff -q -r
> one two Files one/foo and two/foo differ
>
> or, if you prefer
>
> $ diff -q -r -s one two Files one/foo and two/foo differ Files
> one/hello and two/hello are identical
>
> (I'm using gnu diff; other variants might have different command
> options.)
>

- --
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlYM5wYACgkQVKC1jlbQAQdfRgCgkcyjw09g677+T+BUsdDWFb3c
DwAAoL2q8+P/c8oolfNq9WEbhlIL2SvW
=8K4f
-----END PGP SIGNATURE-----