borg-compression.1 4.4 KB

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