LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2007, 02:55 AM   #1
frado
LQ Newbie
 
Registered: May 2005
Location: Nova Milanese (MI/Italy)
Distribution: Slackware
Posts: 20

Rep: Reputation: 0
Question Testing tgz files


Hi,
zip (2.32) fail to zip big files ("zip I/O error: Invalid argument") so I'd like to use tar and gzip to backup my files.
The question is: it is possible to test the archive for integrity, to get md5 of the content, or to have other kind o test? how?

Thanks
frado
 
Old 08-13-2007, 04:37 AM   #2
SCerovec
Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 881

Rep: Reputation: 107Reputation: 107
try
Code:
man gzip
and look for test?
 
Old 08-13-2007, 06:11 AM   #3
frado
LQ Newbie
 
Registered: May 2005
Location: Nova Milanese (MI/Italy)
Distribution: Slackware
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks, but -t option cannot tells me if the archive content is identical to the source, I'd like to have a md5 sum (or other value or tecnique) to fast compare archive to source.
Eg: I'd like to have the possibility to calcolate the md5sum of archive content and source to compare them.

I've tried this commands:
tar -zxOf archive.tgz | md5sum
tar -cvO "source/" | md5sum

but I obtain differente sums.
 
Old 08-13-2007, 08:49 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
I believe tar adds some internal counters/markers etc so it knows what to do with tar file later.
The only way (if you don't trust tar/gzip) is to md5 the source files, tar+gzip & save to a file.
Then extract the tgz somewhere else and md5 the results after they've been unloaded. iow, don't try to do it on the fly.
In fact, normally, you'd add the md5sum val as a file to the tgz file, then use that to check against the new 'after extract' md5.
I guess you could try zcat as well.

Last edited by chrism01; 08-16-2007 at 03:06 AM.
 
Old 08-14-2007, 02:14 AM   #5
frado
LQ Newbie
 
Registered: May 2005
Location: Nova Milanese (MI/Italy)
Distribution: Slackware
Posts: 20

Original Poster
Rep: Reputation: 0
___ Thanks ___
 
Old 08-14-2007, 02:31 AM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Gzip probably does some error-checking, but I think bzip2 does more; so if you're afraid of errors, you might want to see what bzip2 has to offer, and try it; with the default settings (of both) bzip2 does usually slightly smaller packages, and takes some time longer than gzip, but it's up to you to decide. You can use it just like gzip with tar, but with different switch (j instead of z).

Gzip is nice because you can use zcat with it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
when .tgz files are downloaded they turn into .tar files?!?! Flz Slackware 10 12-20-2005 03:32 PM
Setup as getting debian testing files from ftp - will it stay with testing BrianHenderson Debian 2 09-02-2004 07:06 PM
.tgz files mohapi Linux - General 2 05-03-2003 11:11 AM
tgz files Chijtska Linux - General 1 02-07-2002 02:44 PM
.tgz files philfighter Linux - Newbie 6 08-22-2001 03:07 PM


All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration