borg-compact.1 3.3 KB

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