ArGest Backup User Guide

  1. Home
  2. Docs
  3. ArGest Backup User Guide
  4. Terminal Advanced Uses
  5. Using Data Compression: (-Z)

Using Data Compression: (-Z)

If you specify the -Z option, BRU will use compression to make the final size of the archive smaller. The compression algorithm supports multiple levels of compression – the higher the level, the more aggressively BRU will work to compress your data. Also, the higher the number, the harder your CPU will be tasked to perform the compression. The default is to use level 3 compression, but you may adjust this for your needs by specifying the -N level option, where level is the desired compression level (1 to 6) Example.

$ bru -c -Z -N 6 ./

NOTE: The -N option has no effect unless the -Z or -S options are specified. Using this compression technique can result in space savings of 0% to 90% or more depending on the kinds of files being stored. Typically, most files will compress about 30 to 50 percent, however sparse files containing lots of redundant data or zeros, such as typical large database files, may compress as much as 90% or more. If USIZE is the uncompressed size of a file (as shown by ls -l), and CSIZE is the compressed size of a file, BRU defines the compression ratio in percent as:

Ratio = 100 * ( 1 - (CSIZE / USIZE) )

One experiment, using a “typical” mix of files consisting of some text files, some executable binary files, and some miscellaneous data files, gave the following results:

Typical Compression Ratios:

Level Archive Size Ratio
None 7434K 0%
1 4239K 69%
3 4178K 70%
6 4055K 72%

Compression is not the default mode because not all versions of BRU know how to deal with compressed files (early versions of BRU did not support the -Z option).

The disadvantage to the use of compression is that it takes time and extra memory to compress or decompress the files. The overall impact on the archiving time depends on the spare CPU capacity of your system. If BRU is spending most of its time waiting for I/O to complete, then compression may have no noticeable effect on your archiving time. On the other hand, if your system is very busy, or has a slower CPU, then compression can easily double or triple your backup time.

One last hint, the -S option can be used to turn on automatic compression for files larger than a certain threshold size (see the discussion of the -S option later in this chapter). In this case, only those files larger than the specified threshold will be compressed. This is generally much faster than turning on compression for all files, while still providing significant space savings. When using the -S option, it is not necessary to specify the -Z option. NOTE: If your tape drive provides hardware data compression, use it instead of BRU’s compression option. Hardware data compression is normally much faster and more aggressive than BRU’s compression. Since it is generally not possible to gain anything by compressing data that is already compressed, DO NOT use both types of compression. If you do, your tape speed will decrease and tape usage will increase.