Software Compression

For software compression, Bacula backup Jobs can be configured to use ZIP (levels 1 to 9, default is 6), LZO (the level LZ01X) or zstd compression.

This is done on a file by file basis by the File Daemon, before network transit. LZO provides much faster compression and decompression speed but lower compression ratios than GZIP.

Refer to the Bacula Enterprise Main manual, Configuring the Director chapter, The FileSet resource section, compression=..., configured within an Options resource, for more information.

ZLIB-compressed data written by a 64-bit machine may not always uncompress correctly on a 32-bit machine.

Disable Compression for Specific Storage Resource

The FileSet compression configuration can be overridden by the AllowCompression = no directive configured on the Storage resource definition. It means a FileSet with compression = ... directive will not compress the data backed up to a Storage resource that has configured AllowCompression = no (the default is yes). This way, usage of software compression with tape drives can be avoided.

Refer to the Configuring the Director chapter, the Storage resource section, AllowCompression directive for more information.

FileSet Example

Software compression can be achieved by means of the compression=… directives in the FileSet resource. The following example configures GZIP1 compression for the /home directory in the “MyFileSet” FileSet:

FileSet {
   Name = "MyFileSet"
   Include {
      Options {
         wildfile = "*.gz"
         exclude = yes
      }
      Options {
         compression = GZIP1
         signature = SHA1
      }
      File = /home
   }
}

It is strongly recommended to run tests with Jobs/FileSets and some possible compression configurations with a set of current file types and assess which kind of compression is the most suitable for your environment. The bconsole estimate command gives the number of bytes that would be backed up with no compression, as it does not actually process data.

Go back to the Best Practices chapter.

Go back to the main Bacula Enterprise Configuration page.