What is the best tool for compressing and un-compressing files?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the best tool for compressing and un-compressing files?
If a server crashes, we have to tar up about 200 gigs or data. We then transfer it to a new server and untar.
I was just wondering if anyone happens to know if there is a better program to tar and untar? (compress and un-compress)
When compressing millions of files into one it can take hours if not days and with customer sites possibly down, the fastest method can make a huge difference.
Do you have multiple processors/cores? If so, have a look at pigz (http://zlib.net/pigz/).
See here for the developer's comments on the fact that compression is much faster but decompression isn't a great advance over single core. I guess you can't have everything.
pigz would probably be fastest but pxz might be preferable as it uses lzma compression and is the multi-threaded version of xz. while pxz might not be quiet as fast as pbzip (bzip) or pigz (gzip), it has a better compression ratio which will help when transferring the compressed data. Also remember that most these compression utilities have configurable options for compression ratio vs. speed, so check the manpages too.
The different compression tools work best with different types and quantities of data, so you'll probably have to test a few to see which is best for your situation.
Tar is not a tool for compression, it originally was tape archiver and wasn't intended for compression. In fact, it was designed for exactly what you are doing, backing up entire hard drives to secondary storage media.
Many of the other tools which other members have mentioned are typically for compressing, and tar can usually make use of them based on extensions or command line arguments.
If you are backing up data, I recommend still using tar, but also specifying that you wish the contents to be compressed.
A so-called .tar.gz file is a .tar file that has been compressed using the gzip algorithm.
File transfer tools such as rsync and scp have options to apply gzip compression to the transfer, so that the data is compressed on-the-fly before being put onto the wire, and decompressed as it is being taken off.
Compression algorithms are basically a compromise between speed and file-size. In addition to gzip, "(PK)zip" and "bzip2" are in common use.
There have been a number or web pages that give the various types of compression programs a review as to how well they handle files. Knowing both your system and the type of file and size of file may allow you to select the best program. Remember too that many offer levels like .gz does. It's default I think is 5 but can range from about 1 to 9 for speed versus size.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.