borg-recreate.1 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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-RECREATE" "1" "2025-05-19" "" "borg backup tool"
  31. .SH NAME
  32. borg-recreate \- Re-create archives
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] recreate [options] [PATH...]
  36. .SH DESCRIPTION
  37. .sp
  38. Recreate the contents of existing archives.
  39. .sp
  40. recreate is a potentially dangerous function and might lead to data loss
  41. (if used wrongly). BE VERY CAREFUL!
  42. .sp
  43. Important: Repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
  44. .sp
  45. \fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, \fB\-\-exclude\-if\-present\fP, \fB\-\-keep\-exclude\-tags\fP
  46. and PATH have the exact same semantics as in \(dqborg create\(dq, but they only check
  47. for files in the archives and not in the local file system. If PATHs are specified,
  48. the resulting archives will only contain files from these PATHs.
  49. .sp
  50. Note that all paths in an archive are relative, therefore absolute patterns/paths
  51. will \fInot\fP match (\fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, PATHs).
  52. .sp
  53. \fB\-\-chunker\-params\fP will re\-chunk all files in the archive, this can be
  54. used to have upgraded Borg 0.xx archives deduplicate with Borg 1.x archives.
  55. .sp
  56. \fBUSE WITH CAUTION.\fP
  57. Depending on the PATHs and patterns given, recreate can be used to
  58. delete files from archives permanently.
  59. When in doubt, use \fB\-\-dry\-run \-\-verbose \-\-list\fP to see how patterns/PATHS are
  60. interpreted. See \fIlist_item_flags\fP in \fBborg create\fP for details.
  61. .sp
  62. The archive being recreated is only removed after the operation completes. The
  63. archive that is built during the operation exists at the same time at
  64. \(dq<ARCHIVE>.recreate\(dq. The new archive will have a different archive ID.
  65. .sp
  66. With \fB\-\-target\fP the original archive is not replaced, instead a new archive is created.
  67. .sp
  68. When rechunking, space usage can be substantial \- expect
  69. at least the entire deduplicated size of the archives using the previous
  70. chunker params.
  71. .sp
  72. If your most recent borg check found missing chunks, please first run another
  73. backup for the same data, before doing any rechunking. If you are lucky, that
  74. will re\-create the missing chunks. Optionally, do another borg check, to see
  75. if the chunks are still missing).
  76. .SH OPTIONS
  77. .sp
  78. See \fIborg\-common(1)\fP for common options of Borg commands.
  79. .SS arguments
  80. .INDENT 0.0
  81. .TP
  82. .B PATH
  83. paths to recreate; patterns are supported
  84. .UNINDENT
  85. .SS options
  86. .INDENT 0.0
  87. .TP
  88. .B \-\-list
  89. output verbose list of items (files, dirs, ...)
  90. .TP
  91. .BI \-\-filter \ STATUSCHARS
  92. only display items with the given status characters (listed in borg create \-\-help)
  93. .TP
  94. .B \-n\fP,\fB \-\-dry\-run
  95. do not change anything
  96. .TP
  97. .B \-s\fP,\fB \-\-stats
  98. print statistics at end
  99. .UNINDENT
  100. .SS Include/Exclude options
  101. .INDENT 0.0
  102. .TP
  103. .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
  104. exclude paths matching PATTERN
  105. .TP
  106. .BI \-\-exclude\-from \ EXCLUDEFILE
  107. read exclude patterns from EXCLUDEFILE, one per line
  108. .TP
  109. .BI \-\-pattern \ PATTERN
  110. include/exclude paths matching PATTERN
  111. .TP
  112. .BI \-\-patterns\-from \ PATTERNFILE
  113. read include/exclude patterns from PATTERNFILE, one per line
  114. .TP
  115. .B \-\-exclude\-caches
  116. exclude directories that contain a CACHEDIR.TAG file ( <http://www.bford.info/cachedir/spec.html> )
  117. .TP
  118. .BI \-\-exclude\-if\-present \ NAME
  119. exclude directories that are tagged by containing a filesystem object with the given NAME
  120. .TP
  121. .B \-\-keep\-exclude\-tags
  122. if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive
  123. .UNINDENT
  124. .SS Archive filters
  125. .INDENT 0.0
  126. .TP
  127. .BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
  128. only consider archives matching all patterns. see \(dqborg help match\-archives\(dq.
  129. .TP
  130. .BI \-\-sort\-by \ KEYS
  131. Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
  132. .TP
  133. .BI \-\-first \ N
  134. consider first N archives after other filters were applied
  135. .TP
  136. .BI \-\-last \ N
  137. consider last N archives after other filters were applied
  138. .TP
  139. .BI \-\-oldest \ TIMESPAN
  140. consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  141. .TP
  142. .BI \-\-newest \ TIMESPAN
  143. consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
  144. .TP
  145. .BI \-\-older \ TIMESPAN
  146. consider archives older than (now \- TIMESPAN), e.g. 7d or 12m.
  147. .TP
  148. .BI \-\-newer \ TIMESPAN
  149. consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
  150. .TP
  151. .BI \-\-target \ TARGET
  152. create a new archive with the name ARCHIVE, do not replace existing archive
  153. .TP
  154. .BI \-\-comment \ COMMENT
  155. add a comment text to the archive
  156. .TP
  157. .BI \-\-timestamp \ TIMESTAMP
  158. manually specify the archive creation date/time (yyyy\-mm\-ddThh:mm:ss[(+|\-)HH:MM] format, (+|\-)HH:MM is the UTC offset, default: local time zone). Alternatively, give a reference file/directory.
  159. .TP
  160. .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
  161. select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
  162. .TP
  163. .BI \-\-chunker\-params \ PARAMS
  164. rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the chunker defaults. default: do not rechunk
  165. .UNINDENT
  166. .SH EXAMPLES
  167. .INDENT 0.0
  168. .INDENT 3.5
  169. .sp
  170. .EX
  171. # Create a backup with little but fast compression
  172. $ borg create archive /some/files \-\-compression lz4
  173. # Then compress it \- this might take longer, but the backup has already completed,
  174. # so no inconsistencies from a long\-running backup job.
  175. $ borg recreate \-a archive \-\-recompress \-\-compression zlib,9
  176. # Remove unwanted files from all archives in a repository.
  177. # Note the relative path for the \-\-exclude option \- archives only contain relative paths.
  178. $ borg recreate \-\-exclude home/icke/Pictures/drunk_photos
  179. # Change archive comment
  180. $ borg create \-\-comment \(dqThis is a comment\(dq archivename ~
  181. $ borg info \-a archivename
  182. Name: archivename
  183. Fingerprint: ...
  184. Comment: This is a comment
  185. \&...
  186. $ borg recreate \-\-comment \(dqThis is a better comment\(dq \-a archivename
  187. $ borg info \-a archivename
  188. Name: archivename
  189. Fingerprint: ...
  190. Comment: This is a better comment
  191. \&...
  192. .EE
  193. .UNINDENT
  194. .UNINDENT
  195. .SH SEE ALSO
  196. .sp
  197. \fIborg\-common(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP
  198. .SH AUTHOR
  199. The Borg Collective
  200. .\" Generated by docutils manpage writer.
  201. .