Verify integrity of tgz tar file

By.

min read

My profile

Share this:

[code:1:07876e522c]CHECK=$(gunzip -t $tar_file > /dev/null && echo OK || echo FAIL)
if [[ $CHECK == ‘OK’ ]]; then
tar -zxvf $tar_file
fi[/code:1:07876e522c]

Party from : http://www.unix.com/unix-for-advanced-and-expert-users/168070-create-corrupted-tar-gz-file.html

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *