borg-delete.1 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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-DELETE" "1" "2025-04-18" "" "borg backup tool"
  31. .SH NAME
  32. borg-delete \- Delete an existing repository or archives
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...]
  36. .SH DESCRIPTION
  37. .sp
  38. This command deletes an archive from the repository or the complete repository.
  39. .sp
  40. Important: When deleting archives, repository disk space is \fBnot\fP freed until
  41. you run \fBborg compact\fP\&.
  42. .sp
  43. When you delete a complete repository, the security info and local cache for it
  44. (if any) are also deleted. Alternatively, you can delete just the local cache
  45. with the \fB\-\-cache\-only\fP option, or keep the security info with the
  46. \fB\-\-keep\-security\-info\fP option.
  47. .sp
  48. When in doubt, use \fB\-\-dry\-run \-\-list\fP to see what would be deleted.
  49. .sp
  50. When using \fB\-\-stats\fP, you will get some statistics about how much data was
  51. deleted \- the \(dqDeleted data\(dq deduplicated size there is most interesting as
  52. that is how much your repository will shrink.
  53. Please note that the \(dqAll archives\(dq stats refer to the state after deletion.
  54. .sp
  55. You can delete multiple archives by specifying a shell pattern to match
  56. multiple archives using the \fB\-\-glob\-archives GLOB\fP option (for more info on
  57. these patterns, see \fIborg_patterns\fP).
  58. .sp
  59. To avoid accidentally deleting archives, especially when using glob patterns,
  60. it might be helpful to use the \fB\-\-dry\-run\fP to test out the command without
  61. actually making any changes to the repository.
  62. .SH OPTIONS
  63. .sp
  64. See \fIborg\-common(1)\fP for common options of Borg commands.
  65. .SS arguments
  66. .INDENT 0.0
  67. .TP
  68. .B REPOSITORY_OR_ARCHIVE
  69. repository or archive to delete
  70. .TP
  71. .B ARCHIVE
  72. archives to delete
  73. .UNINDENT
  74. .SS options
  75. .INDENT 0.0
  76. .TP
  77. .B \-n\fP,\fB \-\-dry\-run
  78. do not change repository
  79. .TP
  80. .B \-\-list
  81. output verbose list of archives
  82. .TP
  83. .B \-s\fP,\fB \-\-stats
  84. print statistics for the deleted archive
  85. .TP
  86. .B \-\-cache\-only
  87. delete only the local cache for the given repository
  88. .TP
  89. .B \-\-force
  90. force deletion of corrupted archives, use \fB\-\-force \-\-force\fP in case \fB\-\-force\fP does not work.
  91. .TP
  92. .B \-\-keep\-security\-info
  93. keep the local security info when deleting a repository
  94. .TP
  95. .B \-\-save\-space
  96. work slower, but using less space
  97. .TP
  98. .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
  99. write checkpoint every SECONDS seconds (Default: 1800)
  100. .UNINDENT
  101. .SS Archive filters
  102. .INDENT 0.0
  103. .TP
  104. .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX
  105. only consider archive names starting with this prefix. (deprecated)
  106. .TP
  107. .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB
  108. only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq.
  109. .TP
  110. .BI \-\-sort\-by \ KEYS
  111. Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
  112. .TP
  113. .BI \-\-first \ N
  114. consider first N archives after other filters were applied
  115. .TP
  116. .BI \-\-last \ N
  117. consider last N archives after other filters were applied
  118. .UNINDENT
  119. .SH EXAMPLES
  120. .INDENT 0.0
  121. .INDENT 3.5
  122. .sp
  123. .EX
  124. # delete a single backup archive:
  125. $ borg delete /path/to/repo::Monday
  126. # actually free disk space:
  127. $ borg compact /path/to/repo
  128. # delete all archives whose names begin with the machine\(aqs hostname followed by \(dq\-\(dq
  129. $ borg delete \-\-glob\-archives \(aq{hostname}\-*\(aq /path/to/repo
  130. # delete all archives whose names contain \(dq\-2012\-\(dq
  131. $ borg delete \-\-glob\-archives \(aq*\-2012\-*\(aq /path/to/repo
  132. # see what would be deleted if delete was run without \-\-dry\-run
  133. $ borg delete \-\-list \-\-dry\-run \-a \(aq*\-May\-*\(aq /path/to/repo
  134. # delete the whole repository and the related local cache:
  135. $ borg delete /path/to/repo
  136. You requested to completely DELETE the repository *including* all archives it contains:
  137. repo Mon, 2016\-02\-15 19:26:54
  138. root\-2016\-02\-15 Mon, 2016\-02\-15 19:36:29
  139. newname Mon, 2016\-02\-15 19:50:19
  140. Type \(aqYES\(aq if you understand this and want to continue: YES
  141. .EE
  142. .UNINDENT
  143. .UNINDENT
  144. .SH SEE ALSO
  145. .sp
  146. \fIborg\-common(1)\fP, \fIborg\-compact(1)\fP
  147. .SH AUTHOR
  148. The Borg Collective
  149. .\" Generated by docutils manpage writer.
  150. .