borg-compression.1 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-COMPRESSION" "1" "2025-05-22" "" "borg backup tool"
  31. .SH NAME
  32. borg-compression \- Details regarding compression
  33. .SH DESCRIPTION
  34. .sp
  35. It is no problem to mix different compression methods in one repo,
  36. deduplication is done on the source data chunks (not on the compressed
  37. or encrypted data).
  38. .sp
  39. If some specific chunk was once compressed and stored into the repo, creating
  40. another backup that also uses this chunk will not change the stored chunk.
  41. So if you use different compression specs for the backups, whichever stores a
  42. chunk first determines its compression. See also borg recreate.
  43. .sp
  44. Compression is lz4 by default. If you want something else, you have to specify what you want.
  45. .sp
  46. Valid compression specifiers are:
  47. .INDENT 0.0
  48. .TP
  49. .B none
  50. Do not compress.
  51. .TP
  52. .B lz4
  53. Use lz4 compression. Very high speed, very low compression. (default)
  54. .TP
  55. .B zstd[,L]
  56. Use zstd (\(dqzstandard\(dq) compression, a modern wide\-range algorithm.
  57. If you do not explicitly give the compression level L (ranging from 1
  58. to 22), it will use level 3.
  59. .TP
  60. .B zlib[,L]
  61. Use zlib (\(dqgz\(dq) compression. Medium speed, medium compression.
  62. If you do not explicitly give the compression level L (ranging from 0
  63. to 9), it will use level 6.
  64. Giving level 0 (means \(dqno compression\(dq, but still has zlib protocol
  65. overhead) is usually pointless, you better use \(dqnone\(dq compression.
  66. .TP
  67. .B lzma[,L]
  68. Use lzma (\(dqxz\(dq) compression. Low speed, high compression.
  69. If you do not explicitly give the compression level L (ranging from 0
  70. to 9), it will use level 6.
  71. Giving levels above 6 is pointless and counterproductive because it does
  72. not compress better due to the buffer size used by borg \- but it wastes
  73. lots of CPU cycles and RAM.
  74. .TP
  75. .B auto,C[,L]
  76. Use a built\-in heuristic to decide per chunk whether to compress or not.
  77. The heuristic tries with lz4 whether the data is compressible.
  78. For incompressible data, it will not use compression (uses \(dqnone\(dq).
  79. For compressible data, it uses the given C[,L] compression \- with C[,L]
  80. being any valid compression specifier. This can be helpful for media files
  81. which often cannot be compressed much more.
  82. .TP
  83. .B obfuscate,SPEC,C[,L]
  84. Use compressed\-size obfuscation to make fingerprinting attacks based on
  85. the observable stored chunk size more difficult. Note:
  86. .INDENT 7.0
  87. .IP \(bu 2
  88. You must combine this with encryption, or it won\(aqt make any sense.
  89. .IP \(bu 2
  90. Your repo size will be bigger, of course.
  91. .IP \(bu 2
  92. A chunk is limited by the constant \fBMAX_DATA_SIZE\fP (cur. ~20MiB).
  93. .UNINDENT
  94. .sp
  95. The SPEC value determines how the size obfuscation works:
  96. .sp
  97. \fIRelative random reciprocal size variation\fP (multiplicative)
  98. .sp
  99. Size will increase by a factor, relative to the compressed data size.
  100. Smaller factors are used often, larger factors rarely.
  101. .sp
  102. Available factors:
  103. .INDENT 7.0
  104. .INDENT 3.5
  105. .sp
  106. .EX
  107. 1: 0.01 .. 100
  108. 2: 0.1 .. 1,000
  109. 3: 1 .. 10,000
  110. 4: 10 .. 100,000
  111. 5: 100 .. 1,000,000
  112. 6: 1,000 .. 10,000,000
  113. .EE
  114. .UNINDENT
  115. .UNINDENT
  116. .sp
  117. Example probabilities for SPEC \fB1\fP:
  118. .INDENT 7.0
  119. .INDENT 3.5
  120. .sp
  121. .EX
  122. 90 % 0.01 .. 0.1
  123. 9 % 0.1 .. 1
  124. 0.9 % 1 .. 10
  125. 0.09% 10 .. 100
  126. .EE
  127. .UNINDENT
  128. .UNINDENT
  129. .sp
  130. \fIRandomly sized padding up to the given size\fP (additive)
  131. .INDENT 7.0
  132. .INDENT 3.5
  133. .sp
  134. .EX
  135. 110: 1kiB (2 ^ (SPEC \- 100))
  136. \&...
  137. 120: 1MiB
  138. \&...
  139. 123: 8MiB (max.)
  140. .EE
  141. .UNINDENT
  142. .UNINDENT
  143. .sp
  144. \fIPadmé padding\fP (deterministic)
  145. .INDENT 7.0
  146. .INDENT 3.5
  147. .sp
  148. .EX
  149. 250: pads to sums of powers of 2, max 12% overhead
  150. .EE
  151. .UNINDENT
  152. .UNINDENT
  153. .sp
  154. Uses the Padmé algorithm to deterministically pad the compressed size to a sum of
  155. powers of 2, limiting overhead to 12%. See <https://lbarman.ch/blog/padme/> for details.
  156. .UNINDENT
  157. .sp
  158. Examples:
  159. .INDENT 0.0
  160. .INDENT 3.5
  161. .sp
  162. .EX
  163. borg create \-\-compression lz4 \-\-repo REPO ARCHIVE data
  164. borg create \-\-compression zstd \-\-repo REPO ARCHIVE data
  165. borg create \-\-compression zstd,10 \-\-repo REPO ARCHIVE data
  166. borg create \-\-compression zlib \-\-repo REPO ARCHIVE data
  167. borg create \-\-compression zlib,1 \-\-repo REPO ARCHIVE data
  168. borg create \-\-compression auto,lzma,6 \-\-repo REPO ARCHIVE data
  169. borg create \-\-compression auto,lzma ...
  170. borg create \-\-compression obfuscate,110,none ...
  171. borg create \-\-compression obfuscate,3,auto,zstd,10 ...
  172. borg create \-\-compression obfuscate,2,zstd,6 ...
  173. borg create \-\-compression obfuscate,250,zstd,3 ...
  174. .EE
  175. .UNINDENT
  176. .UNINDENT
  177. .SH AUTHOR
  178. The Borg Collective
  179. .\" Generated by docutils manpage writer.
  180. .