vortipad.blogg.se

Tar compress
Tar compress










tar compress
  1. TAR COMPRESS INSTALL
  2. TAR COMPRESS ARCHIVE

Improper usage of any archival program can cause unintended data loss. It will detail the creation and restoration of archives, including operation over a network.īefore continuing users are encouraged to read the TerminalHowto page which explains many basic concepts related to working with a terminal. This subpage will acquaint a user with the tar archival program, a CLI solution to the creation of compressed archival backups.

TAR COMPRESS INSTALL

bz2 extension to the tar filename), then you will want to have done sudo apt install bzip2 (or sudo yum install bzip2) on your target computer which is to decompress the file.This page is part of the BackupYourSystem article, as such, ensure you've read that prior to continuing. For example, if the original compression algorithm was bzip2 (indicated by a. Decompressing a Fileĭecompressing a file is super easy, whatever the original method was to compress it, and provided that such compression algorithm is present on your computer. Still, the bzip2 and xz algorithms may show improvements with other data sets. There are two other common compression algorithms which one may explore and test (different algorithm options also give different sizing outcomes, and may have additional compression options), and that is bzip2, which can be used by specifying the -j option to tar, and XZ which can be used by specifying the -J option.Īlternatively, you can use the -I command to set maximum compression options for bzip2 ( -9):Īs you can see, the results are less good in this case then using the somewhat standard GZIP algorithm. You can set your own preference by varying the compression level from -1 (fast) to -9 (slow) Other Compression Programs And, the slower the compression (higher level of compression attempts, i.e. Generally speaking, the faster the compression (lower level of compression attempts, i.e. The result is that we 12 bytes less as a result of a better (but generally slower) compression attempt (at level -9) by GZIP. Here we specified -I 'gzip -9' as the compression program to use, and we dropped the -z option (as we are now specifying a specific custom program to use instead of using the built-in tar GZIP configuration). We can set the maximum compression option of GZIP by using the -I option to tar which lets us specify a compression program to use (with thanks to stackoverflow user ideasman42): tar -I 'gzip -9' -hcf all_

tar compress

Gaining More Bytes Using High Level CompressionĬan we make the file even smaller? Yes. Still, one algorithm (like the GZIP one) may be better then another (like for example BZIP2), and vice versa, for different data sets.

TAR COMPRESS ARCHIVE

The total size of the archive is 7.44 times larger then the total file size, but it matters little as this fictive example is not representative of compressing large files where gains instead of losses are almost always seen, unless the data was pre-compressed or is of such a format that it cannot be condensed easily using a variety of algorithms. It is great to see that we end up with a 186 byte file, which tells us that – in this case – the tar header / overhead of about 10Kb can be compressed very well. tar file once the dumping of data into it is complete. We also included the -z option which will use GZIP compression to compress the resulting. The files are simply being archived and some overall overhead for tar is being added. As you can see, the tar file is much larger then all of our files combined. Using tar -fch test.tar * will not work:Īfter the tar is generated, we use a modified ls output which clearly shows us the number of bytes per file.

tar compress

It thus has to come last in our option chain (as it requires an option) so we can add the archive file name directly behind it. The -f option allows us to specify the name of the archive. Note that by default directories are archived recursively, unless a –no-recursion option is also used. The -c option stand for create a new archive. instead of specifying another -, we simply tag them onto the other shorthand options. Note that they are just written together with the - in -h, i.e. This option stands for dereference, which will dereference (or follow) symlinks, archiving and dumping the files they point to.

tar compress

Firstly, we have -h which though not required in this particular case, I highly recommend to always include in your tar commands.












Tar compress