borg-compact.1 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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-COMPACT" "1" "2025-10-31" "" "borg backup tool"
  31. .SH NAME
  32. borg-compact \- compact segment files in the repository
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] compact [options] [REPOSITORY]
  36. .SH DESCRIPTION
  37. .sp
  38. This command frees repository space by compacting segments.
  39. .sp
  40. Use this regularly to avoid running out of space \- you do not need to use this
  41. after each borg command though. It is especially useful after deleting archives,
  42. because only compaction will really free repository space.
  43. .sp
  44. borg compact does not need a key, so it is possible to invoke it from the
  45. client or also from the server.
  46. .sp
  47. Depending on the amount of segments that need compaction, it may take a while,
  48. so consider using the \fB\-\-progress\fP option.
  49. .sp
  50. A segment is compacted if the amount of saved space is above the percentage value
  51. given by the \fB\-\-threshold\fP option. If omitted, a threshold of 10% is used.
  52. When using \fB\-\-verbose\fP, borg will output an estimate of the freed space.
  53. .sp
  54. For maximum compaction, use \fB\-\-threshold 0\fP\&. This will compact whenever any
  55. space can be saved and thus rewrites the most data; it can be much slower on
  56. large repositories. Using \fB\-\-threshold 1\fP usually achieves nearly the same
  57. result significantly faster. Higher thresholds (e.g. the default 10) trade
  58. compaction thoroughness for speed. Note: \fB\-\-threshold 100\fP will effectively
  59. compact nothing.
  60. .sp
  61. After upgrading borg (server) to 1.2+, you can use \fBborg compact \-\-cleanup\-commits\fP
  62. to clean up the numerous 17\-byte commit\-only segments that borg 1.1 did not clean up
  63. due to a bug. It is enough to do that once per repository. After cleaning up the
  64. commits, borg will also do a normal compaction.
  65. .sp
  66. See \fIseparate_compaction\fP in Additional Notes for more details.
  67. .SH OPTIONS
  68. .sp
  69. See \fIborg\-common(1)\fP for common options of Borg commands.
  70. .SS arguments
  71. .INDENT 0.0
  72. .TP
  73. .B REPOSITORY
  74. repository to compact
  75. .UNINDENT
  76. .SS options
  77. .INDENT 0.0
  78. .TP
  79. .B \-n\fP,\fB \-\-dry\-run
  80. do nothing
  81. .TP
  82. .B \-\-cleanup\-commits
  83. cleanup commit\-only 17\-byte segment files
  84. .TP
  85. .BI \-\-threshold \ PERCENT
  86. set minimum threshold for saved space in PERCENT (Default: 10)
  87. .UNINDENT
  88. .SH EXAMPLES
  89. .INDENT 0.0
  90. .INDENT 3.5
  91. .sp
  92. .EX
  93. # compact segments and free repo disk space
  94. $ borg compact /path/to/repo
  95. # same as above plus clean up 17\-byte commit\-only segments
  96. $ borg compact \-\-cleanup\-commits /path/to/repo
  97. .EE
  98. .UNINDENT
  99. .UNINDENT
  100. .SH SEE ALSO
  101. .sp
  102. \fIborg\-common(1)\fP
  103. .SH AUTHOR
  104. The Borg Collective
  105. .\" Generated by docutils manpage writer.
  106. .