Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A knack to TAR?

Status
Not open for further replies.

MCubitt

Programmer
Mar 14, 2002
1,081
GB
I am trying to TAR some Oracle archivelog files (see other thread regarding TARing all but latest).

However, I was surprised to see my TAR had little affect on the file size.

Using the following convention:
tar -cvvf arch0000000074.tar arch0000000074.arc

The results were:
oracle 52428288 19 Feb 00:14 arch0000000073.arc
oracle 52439040 21 Feb 09:27 arch0000000073.tar
oracle 52427776 19 Feb 00:21 arch0000000074.arc
oracle 52439040 21 Feb 09:29 arch0000000074.tar




Applications Support
UK
 
Tar is not a compression routine, it was originally designed to do backups. If you want to compress the files then use compress or gzip

What tar does do is wrap up a number of files into one. So to have all your *.arc files in one handy compressed file try
Code:
compress *.arc
tar -cvf Oracle.arc *.Z

Columb Healy
 
tar doesn't compress, it just creates a tar file, which as you see above are larger than the original! I'd untar these and use compress or gzip to compress them, assuming this is what you require.
 
Columb,

Thank you for that information, I always assumed (oops!) it was a compression tool!

Now I get some good rates. All I need to do is TAR to one file then compress it!

cheers


Applications Support
UK
 
Apologies, Columb. we were obviously posting at the same time. Still, two heads are better than one as the push-me-pull-you would agree!
 
No appologies neccessary. At least we agree!

Columb Healy
 
You've got the right idea, MCubbit.

Tarring before compressing is not only a simpler process, it makes a smaller file because it also compresses the data that tar adds.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top