Edit 3: For people who will read this question:
--verify mysteriously fails with "Warning: Cannot seek: Illegal seek", hence I recommend you look for alternative ways to verify your archives. My original question follows.
Short of restoring it, what is a proper way to ensure the integrity of a
.tar.gz backup? I'm using
According to the man page of
tar and to what I have read around,
tar offers a
--verify option while creating an archive and a
--diff option to find differences between an existing archive and the file system.
Is a check with
--diff redundant right after creating an archive with
--verify? Or is
--diff more reliable and hence a previous
--verify is redundant, unless you want your backup procedure to fail fast?
Should we invoke
gzip --test as well to verify the
.gz archive, or does
tar perform such a check on its own already, both with
--diff? I would say it does.
Thanks for your attention.
Edit: As suggested by Lgeorget, I could store an hash of the archive as well, to check at restoration time that the archive has not been corrupted.
Edit 2: Hence, apparently
--verify would be enough. Maybe I could use
tar --list to check that the archive is readable and extractable. I also wonder whether
--diff checks the contents of files or just their names (and possibly attributes).