I also found this link. But I was wondering if there is any ready made command line solution?
views:
752answers:
2
+1
A:
you could probably use the gzip -t option to test the files integrity
http://linux.about.com/od/commands/l/blcmdl1_gzip.htm
To test the gzip file is not corrupt:
gunzip -t file.gz
To test the tar file inside is not corrupt:
gunzip -c file.gz | tar tf file.tar.gz
As part of the backup you could probably just run the latter command and check the value of $? afterwards for a 0 (success) value. If either the tar or the gzip has an issue, $? will have a non zero value.
John Boker
2010-01-04 19:51:13
+2
A:
G'day,
what about just getting a listing of the tarball and throw away the output?
tar -tvzf my_tar.tar.gz >/dev/null
rather than uncompressing the file?
Rob Wells
2010-01-04 19:51:30