-
Notifications
You must be signed in to change notification settings - Fork 0
Compressors
Currently supported compressors:
- Gzip
- Bzip2
- Lzma
- Pbzip2
The following examples should be placed in your Backup configuration file.
Backup::Model.new(:my_backup, 'My Backup') do
# examples go here...
endcompress_with Gzip do |compression|
compression.best = true
compression.fast = false
endThis will compress your backup files using Gzip (best compression, rather than fast).
This requires you to have the Gzip utility installed on your machine.
compress_with Bzip2 do |compression|
compression.best = true
compression.fast = false
endThis will compress your backup files using Bzip2 (best compression, rather than fast).
This requires you to have the Bzip2 utility installed on your machine.
compress_with Lzma do |compression|
compression.best = true
compression.fast = false
endThis will compress your backup files using Lzma (best compression, rather than fast).
This requires you to have the Lzma utility installed on your machine.
compress_with Pbzip2 do |compression|
compression.best = true
compression.fast = false
endThis will compress your backup files using Pbzip2 (best compression, rather than fast).
Pbzip2 by default will auto detect cpu count and use all for compression.
It can be changed with processors option.
This requires you to have the Pbzip2 utility installed on your machine.
If you are planning to compress multiple backups and usually want to use the same options
(best compression, rather than fast). Then you can set the default Gzip compression to best like so:
Backup::Configuration::Compressor::Gzip.defaults do |compression|
compression.best = true
endSo now, every time you wish to compress a backup with Gzip in best compression mode,
all you have to add to your configuration file is the following:
compress_with Gzipand you won't have to specify compression.best = true since it is now the default option,
unless overwritten within the compress_with block.