summaryrefslogtreecommitdiffstats
path: root/docs/man/borg-compression.1
blob: e0a98ed12b8c3b79eba6362ff0b20f8b79764da4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.\" Man page generated from reStructuredText.
.
.TH BORG-COMPRESSION 1 "2017-03-26" "" "borg backup tool"
.SH NAME
borg-compression \- Details regarding compression
.
.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
..
.SH DESCRIPTION
.sp
Compression is lz4 by default. If you want something else, you have to specify what you want.
.sp
Valid compression specifiers are:
.sp
none
.INDENT 0.0
.INDENT 3.5
Do not compress.
.UNINDENT
.UNINDENT
.sp
lz4
.INDENT 0.0
.INDENT 3.5
Use lz4 compression. High speed, low compression. (default)
.UNINDENT
.UNINDENT
.sp
zlib[,L]
.INDENT 0.0
.INDENT 3.5
Use zlib ("gz") compression. Medium speed, medium compression.
If you do not explicitely give the compression level L (ranging from 0
to 9), it will use level 6.
Giving level 0 (means "no compression", but still has zlib protocol
overhead) is usually pointless, you better use "none" compression.
.UNINDENT
.UNINDENT
.sp
lzma[,L]
.INDENT 0.0
.INDENT 3.5
Use lzma ("xz") compression. Low speed, high compression.
If you do not explicitely give the compression level L (ranging from 0
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.
.UNINDENT
.UNINDENT
.sp
auto,C[,L]
.INDENT 0.0
.INDENT 3.5
Use a built\-in heuristic to decide per chunk whether to compress or not.
The heuristic tries with lz4 whether the data is compressible.
For incompressible data, it will not use compression (uses "none").
For compressible data, it uses the given C[,L] compression \- with C[,L]
being any valid compression specifier.
.UNINDENT
.UNINDENT
.sp
The decision about which compression to use is done by borg like this:
.INDENT 0.0
.IP 1. 3
find a compression specifier (per file):
match the path/filename against all patterns in all \-\-compression\-from
files (if any). If a pattern matches, use the compression spec given for
that pattern. If no pattern matches (and also if you do not give any
\-\-compression\-from option), default to the compression spec given by
\-\-compression. See docs/misc/compression.conf for an example config.
.IP 2. 3
if the found compression spec is not "auto", the decision is taken:
use the found compression spec.
.IP 3. 3
if the found compression spec is "auto", test compressibility of each
chunk using lz4.
If it is compressible, use the C,[L] compression spec given within the
"auto" specifier. If it is not compressible, use no compression.
.UNINDENT
.sp
Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
borg create \-\-compression lz4 REPO::ARCHIVE data
borg create \-\-compression zlib REPO::ARCHIVE data
borg create \-\-compression zlib,1 REPO::ARCHIVE data
borg create \-\-compression auto,lzma,6 REPO::ARCHIVE data
borg create \-\-compression\-from compression.conf \-\-compression auto,lzma ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
compression.conf has entries like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# example config file for \-\-compression\-from option
#
# Format of non\-comment / non\-empty lines:
# <compression\-spec>:<path/filename pattern>
# compression\-spec is same format as for \-\-compression option
# path/filename pattern is same format as for \-\-exclude option
none:*.gz
none:*.zip
none:*.mp3
none:*.ogg
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
General remarks:
.sp
It is no problem to mix different compression methods in one repo,
deduplication is done on the source data chunks (not on the compressed
or encrypted data).
.sp
If some specific chunk was once compressed and stored into the repo, creating
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
chunk first determines its compression. See also borg recreate.
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.