View Single Post
  #5   (View Single Post)  
Old 31st May 2011
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by J65nko View Post
You could check if the file/archive is corrupted with the utility file(1)
Actually, file is not likely to tell you the file is corrupt. It only tries to guess the type of file it is based on a few magic numbers found at the start of the file. Any corruption outside of what it looks at will go unnoticed.

Quote:
Then do a verbose test with tar(1)
Actually, the t option to tar just does a listing; with the z flag it knows to un-gzip first, and so this is probably a decent pragmatic test.

A direct test of the compressed file can be done with gzip in test mode:

% gzip -tv foo.tgz

Of course this doesn't test the contained tar archive. You could also compare with an independent checksum.

Last edited by IdOp; 31st May 2011 at 04:25 PM.
Reply With Quote