borg-compact.1 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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-05-22" "" "borg backup tool"
  31. .SH NAME
  32. borg-compact \- Collect garbage in repository
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] compact [options]
  36. .SH DESCRIPTION
  37. .sp
  38. Free repository space by deleting unused chunks.
  39. .sp
  40. borg compact analyzes all existing archives to find out which repository
  41. objects are actually used (referenced). It then deletes all unused objects
  42. from the repository to free space.
  43. .sp
  44. Unused objects may result from:
  45. .INDENT 0.0
  46. .IP \(bu 2
  47. borg delete or prune usage
  48. .IP \(bu 2
  49. interrupted backups (maybe retry the backup first before running compact)
  50. .IP \(bu 2
  51. backup of source files that had an I/O error in the middle of their contents
  52. and that were skipped due to this
  53. .IP \(bu 2
  54. corruption of the repository (e.g. the archives directory having lost
  55. entries, see notes below)
  56. .UNINDENT
  57. .sp
  58. You usually don\(aqt want to run \fBborg compact\fP after every write operation, but
  59. either regularly (e.g. once a month, possibly together with \fBborg check\fP) or
  60. when disk space needs to be freed.
  61. .sp
  62. \fBImportant:\fP
  63. .sp
  64. After compacting it is no longer possible to use \fBborg undelete\fP to recover
  65. previously soft\-deleted archives.
  66. .sp
  67. \fBborg compact\fP might also delete data from archives that were \(dqlost\(dq due to
  68. archives directory corruption. Such archives could potentially be restored with
  69. \fBborg check \-\-find\-lost\-archives [\-\-repair]\fP, which is slow. You therefore
  70. might not want to do that unless there are signs of lost archives (e.g. when
  71. seeing fatal errors when creating backups or when archives are missing in
  72. \fBborg repo\-list\fP).
  73. .sp
  74. When giving the \fB\-\-stats\fP option, borg will internally list all repository
  75. objects to determine their existence AND stored size. It will build a fresh
  76. chunks index from that information and cache it in the repository. For some
  77. types of repositories, this might be very slow. It will tell you the sum of
  78. stored object sizes, before and after compaction.
  79. .sp
  80. Without \fB\-\-stats\fP, borg will rely on the cached chunks index to determine
  81. existing object IDs (but there is no stored size information in the index,
  82. thus it can\(aqt compute before/after compaction size statistics).
  83. .SH OPTIONS
  84. .sp
  85. See \fIborg\-common(1)\fP for common options of Borg commands.
  86. .SS options
  87. .INDENT 0.0
  88. .TP
  89. .B \-n\fP,\fB \-\-dry\-run
  90. do nothing
  91. .TP
  92. .B \-s\fP,\fB \-\-stats
  93. print statistics (might be much slower)
  94. .UNINDENT
  95. .SH EXAMPLES
  96. .INDENT 0.0
  97. .INDENT 3.5
  98. .sp
  99. .EX
  100. # compact segments and free repo disk space
  101. $ borg compact
  102. .EE
  103. .UNINDENT
  104. .UNINDENT
  105. .SH SEE ALSO
  106. .sp
  107. \fIborg\-common(1)\fP
  108. .SH AUTHOR
  109. The Borg Collective
  110. .\" Generated by docutils manpage writer.
  111. .