borgbackup/docs/man/borg-compression.1

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

181 lines
5.1 KiB
Groff
Raw Normal View History

2026-03-15 09:34:31 -04:00
.\" Man page generated from reStructuredText
.\" by the Docutils 0.22.4 manpage writer.
2017-02-05 08:22:06 -05:00
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
2026-06-16 08:17:43 -04:00
.TH "borg-compression" "1" "2026-06-16" "" "borg backup tool"
2026-03-15 09:34:31 -04:00
.SH Name
2022-06-23 19:19:19 -04:00
borg-compression \- Details regarding compression
2017-02-05 08:22:06 -05:00
.SH DESCRIPTION
.sp
2025-12-23 12:00:09 -05:00
It is no problem to mix different compression methods in one repository,
2017-06-18 06:13:28 -04:00
deduplication is done on the source data chunks (not on the compressed
or encrypted data).
.sp
2025-12-23 12:00:09 -05:00
If some specific chunk was once compressed and stored into the repository, creating
2017-06-18 06:13:28 -04:00
another backup that also uses this chunk will not change the stored chunk.
So if you use different compression specs for the backups, whichever stores a
2025-12-23 12:00:09 -05:00
chunk first determines its compression. See also \fBborg recreate\fP\&.
2017-06-18 06:13:28 -04:00
.sp
2017-03-26 19:58:19 -04:00
Compression is lz4 by default. If you want something else, you have to specify what you want.
2017-02-05 08:22:06 -05:00
.sp
Valid compression specifiers are:
.INDENT 0.0
2017-06-18 06:13:28 -04:00
.TP
.B none
2017-03-26 19:58:19 -04:00
Do not compress.
2017-06-18 06:13:28 -04:00
.TP
.B lz4
2019-02-24 14:40:07 -05:00
Use lz4 compression. Very high speed, very low compression. (default)
.TP
.B zstd[,L]
2022-09-10 10:03:27 -04:00
Use zstd (\(dqzstandard\(dq) compression, a modern wide\-range algorithm.
2019-02-24 14:40:07 -05:00
If you do not explicitly give the compression level L (ranging from 1
to 22), it will use level 3.
2017-06-18 06:13:28 -04:00
.TP
.B zlib[,L]
2022-09-10 10:03:27 -04:00
Use zlib (\(dqgz\(dq) compression. Medium speed, medium compression.
If you do not explicitly give the compression level L (ranging from 0
2017-02-05 08:22:06 -05:00
to 9), it will use level 6.
2022-09-10 10:03:27 -04:00
Giving level 0 (means \(dqno compression\(dq, but still has zlib protocol
overhead) is usually pointless, you better use \(dqnone\(dq compression.
2017-06-18 06:13:28 -04:00
.TP
.B lzma[,L]
2022-09-10 10:03:27 -04:00
Use lzma (\(dqxz\(dq) compression. Low speed, high compression.
If you do not explicitly give the compression level L (ranging from 0
2017-02-05 08:22:06 -05:00
to 9), it will use level 6.
Giving levels above 6 is pointless and counterproductive because it does
not compress better due to the buffer size used by borg \- but it wastes
lots of CPU cycles and RAM.
2017-06-18 06:13:28 -04:00
.TP
.B auto,C[,L]
2017-02-05 08:22:06 -05:00
Use a built\-in heuristic to decide per chunk whether to compress or not.
The heuristic tries with lz4 whether the data is compressible.
2022-09-10 10:03:27 -04:00
For incompressible data, it will not use compression (uses \(dqnone\(dq).
2017-02-05 08:22:06 -05:00
For compressible data, it uses the given C[,L] compression \- with C[,L]
2024-11-16 14:14:16 -05:00
being any valid compression specifier. This can be helpful for media files
which often cannot be compressed much more.
2020-12-06 14:45:41 -05:00
.TP
.B obfuscate,SPEC,C[,L]
Use compressed\-size obfuscation to make fingerprinting attacks based on
2023-06-11 17:10:23 -04:00
the observable stored chunk size more difficult. Note:
.INDENT 7.0
.IP \(bu 2
You must combine this with encryption, or it won\(aqt make any sense.
.IP \(bu 2
Your repo size will be bigger, of course.
.IP \(bu 2
A chunk is limited by the constant \fBMAX_DATA_SIZE\fP (cur. ~20MiB).
.UNINDENT
.sp
The SPEC value determines how the size obfuscation works:
2020-12-06 14:45:41 -05:00
.sp
2023-06-11 17:10:23 -04:00
\fIRelative random reciprocal size variation\fP (multiplicative)
2020-12-06 14:45:41 -05:00
.sp
Size will increase by a factor, relative to the compressed data size.
2023-06-11 17:10:23 -04:00
Smaller factors are used often, larger factors rarely.
.sp
Available factors:
.INDENT 7.0
.INDENT 3.5
.sp
2025-04-21 15:07:46 -04:00
.EX
2023-06-11 17:10:23 -04:00
1: 0.01 .. 100
2: 0.1 .. 1,000
3: 1 .. 10,000
4: 10 .. 100,000
5: 100 .. 1,000,000
6: 1,000 .. 10,000,000
2025-04-21 15:07:46 -04:00
.EE
2023-06-11 17:10:23 -04:00
.UNINDENT
.UNINDENT
.sp
Example probabilities for SPEC \fB1\fP:
.INDENT 7.0
.INDENT 3.5
.sp
2025-04-21 15:07:46 -04:00
.EX
2023-06-11 17:10:23 -04:00
90 % 0.01 .. 0.1
9 % 0.1 .. 1
0.9 % 1 .. 10
0.09% 10 .. 100
2025-04-21 15:07:46 -04:00
.EE
2023-06-11 17:10:23 -04:00
.UNINDENT
.UNINDENT
.sp
\fIRandomly sized padding up to the given size\fP (additive)
.INDENT 7.0
.INDENT 3.5
2020-12-06 14:45:41 -05:00
.sp
2025-04-21 15:07:46 -04:00
.EX
2023-06-11 17:10:23 -04:00
110: 1kiB (2 ^ (SPEC \- 100))
2020-12-06 14:45:41 -05:00
\&...
120: 1MiB
\&...
123: 8MiB (max.)
2025-04-21 15:07:46 -04:00
.EE
2023-06-11 17:10:23 -04:00
.UNINDENT
.UNINDENT
2025-04-21 15:07:46 -04:00
.sp
\fIPadmé padding\fP (deterministic)
.INDENT 7.0
.INDENT 3.5
.sp
.EX
250: pads to sums of powers of 2, max 12% overhead
.EE
.UNINDENT
.UNINDENT
.sp
Uses the Padmé algorithm to deterministically pad the compressed size to a sum of
2026-03-15 09:34:31 -04:00
powers of 2, limiting overhead to 12%. See \%<https://\:lbarman\:.ch/\:blog/\:padme/> for details.
2017-02-05 08:22:06 -05:00
.UNINDENT
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
2025-04-21 15:07:46 -04:00
.EX
borg create \-\-compression lz4 \-\-repo REPO ARCHIVE data
borg create \-\-compression zstd \-\-repo REPO ARCHIVE data
borg create \-\-compression zstd,10 \-\-repo REPO ARCHIVE data
borg create \-\-compression zlib \-\-repo REPO ARCHIVE data
borg create \-\-compression zlib,1 \-\-repo REPO ARCHIVE data
borg create \-\-compression auto,lzma,6 \-\-repo REPO ARCHIVE data
2017-04-29 19:32:26 -04:00
borg create \-\-compression auto,lzma ...
2023-06-11 17:10:23 -04:00
borg create \-\-compression obfuscate,110,none ...
2020-12-06 14:45:41 -05:00
borg create \-\-compression obfuscate,3,auto,zstd,10 ...
borg create \-\-compression obfuscate,2,zstd,6 ...
2025-04-21 15:07:46 -04:00
borg create \-\-compression obfuscate,250,zstd,3 ...
.EE
2017-02-05 08:22:06 -05:00
.UNINDENT
.UNINDENT
2026-03-15 09:34:31 -04:00
.SH Author
2017-02-05 08:22:06 -05:00
The Borg Collective
2026-03-15 09:34:31 -04:00
.\" End of generated man page.