Ask HN: How do you verify backups?

  • I use rsync to generate and compare checksums of the original against the backup:

        rsync -cavin --info=name2 --no-perms --no-owner --no-group /local/data/path/ user@host:/remote/data/path/ | grep -e '<' -e '>'
    
    grep finds difference markers in the output.

    -c for checksum generation.

    -n for dry-run mode so rsync doesn't transmit files.

  • In my own personal use-case: my backups include a file that contains a list of every file that is backed up and each file's xxhash.[1] So verification is as simple as running "xxhsum --check" on this file. This is a bit slow, but it's much faster than something like SHA-256. And I don't know what scheme would be significantly faster. I just threw this together to solve my problem of verifying backups, without doing much research into the problem.

    The backup is to physical media so that makes this scheme easy. Don't know if or how this could be applied to online backups.

    [1]: https://cyan4973.github.io/xxHash/

  • The only real test is to restore and verify. some systems allow mounting an backup, this could be an middle way.

  • undefined