borg-recreate.1 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 "2023-09-14" "" "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\-\-recompress\fP allows one to change the compression of existing data in archives.
  54. Due to how Borg stores compressed size information this might display
  55. incorrect information for archives that were not recreated at the same time.
  56. There is no risk of data loss by this.
  57. .sp
  58. \fB\-\-chunker\-params\fP will re\-chunk all files in the archive, this can be
  59. used to have upgraded Borg 0.xx archives deduplicate with Borg 1.x archives.
  60. .sp
  61. \fBUSE WITH CAUTION.\fP
  62. Depending on the PATHs and patterns given, recreate can be used to
  63. delete files from archives permanently.
  64. When in doubt, use \fB\-\-dry\-run \-\-verbose \-\-list\fP to see how patterns/PATHS are
  65. interpreted. See \fIlist_item_flags\fP in \fBborg create\fP for details.
  66. .sp
  67. The archive being recreated is only removed after the operation completes. The
  68. archive that is built during the operation exists at the same time at
  69. \(dq<ARCHIVE>.recreate\(dq. The new archive will have a different archive ID.
  70. .sp
  71. With \fB\-\-target\fP the original archive is not replaced, instead a new archive is created.
  72. .sp
  73. When rechunking (or recompressing), space usage can be substantial \- expect
  74. at least the entire deduplicated size of the archives using the previous
  75. chunker (or compression) params.
  76. .sp
  77. If you recently ran borg check \-\-repair and it had to fix lost chunks with all\-zero
  78. replacement chunks, please first run another backup for the same data and re\-run
  79. borg check \-\-repair afterwards to heal any archives that had lost chunks which are
  80. still generated from the input data.
  81. .sp
  82. Important: running borg recreate to re\-chunk will remove the chunks_healthy
  83. metadata of all items with replacement chunks, so healing will not be possible
  84. any more after re\-chunking (it is also unlikely it would ever work: due to the
  85. change of chunking parameters, the missing chunk likely will never be seen again
  86. even if you still have the data that produced it).
  87. .SH OPTIONS
  88. .sp
  89. See \fIborg\-common(1)\fP for common options of Borg commands.
  90. .SS arguments
  91. .INDENT 0.0
  92. .TP
  93. .B PATH
  94. paths to recreate; patterns are supported
  95. .UNINDENT
  96. .SS options
  97. .INDENT 0.0
  98. .TP
  99. .B \-\-list
  100. output verbose list of items (files, dirs, ...)
  101. .TP
  102. .BI \-\-filter \ STATUSCHARS
  103. only display items with the given status characters (listed in borg create \-\-help)
  104. .TP
  105. .B \-n\fP,\fB \-\-dry\-run
  106. do not change anything
  107. .TP
  108. .B \-s\fP,\fB \-\-stats
  109. print statistics at end
  110. .UNINDENT
  111. .SS Include/Exclude options
  112. .INDENT 0.0
  113. .TP
  114. .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
  115. exclude paths matching PATTERN
  116. .TP
  117. .BI \-\-exclude\-from \ EXCLUDEFILE
  118. read exclude patterns from EXCLUDEFILE, one per line
  119. .TP
  120. .BI \-\-pattern \ PATTERN
  121. include/exclude paths matching PATTERN
  122. .TP
  123. .BI \-\-patterns\-from \ PATTERNFILE
  124. read include/exclude patterns from PATTERNFILE, one per line
  125. .TP
  126. .B \-\-exclude\-caches
  127. exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.bford.info/cachedir/spec.html\fP)
  128. .TP
  129. .BI \-\-exclude\-if\-present \ NAME
  130. exclude directories that are tagged by containing a filesystem object with the given NAME
  131. .TP
  132. .B \-\-keep\-exclude\-tags
  133. if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive
  134. .UNINDENT
  135. .SS Archive filters
  136. .INDENT 0.0
  137. .TP
  138. .BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
  139. only consider archive names matching the pattern. see \(dqborg help match\-archives\(dq.
  140. .TP
  141. .BI \-\-sort\-by \ KEYS
  142. Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
  143. .TP
  144. .BI \-\-first \ N
  145. consider first N archives after other filters were applied
  146. .TP
  147. .BI \-\-last \ N
  148. consider last N archives after other filters were applied
  149. .TP
  150. .BI \-\-oldest \ TIMESPAN
  151. consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  152. .TP
  153. .BI \-\-newest \ TIMESPAN
  154. consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
  155. .TP
  156. .BI \-\-older \ TIMESPAN
  157. consider archives older than (now \- TIMESPAN), e.g. 7d oder 12m.
  158. .TP
  159. .BI \-\-newer \ TIMESPAN
  160. consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
  161. .TP
  162. .BI \-\-target \ TARGET
  163. create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive)
  164. .TP
  165. .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
  166. write checkpoint every SECONDS seconds (Default: 1800)
  167. .TP
  168. .BI \-\-checkpoint\-volume \ BYTES
  169. write checkpoint every BYTES bytes (Default: 0, meaning no volume based checkpointing)
  170. .TP
  171. .BI \-\-comment \ COMMENT
  172. add a comment text to the archive
  173. .TP
  174. .BI \-\-timestamp \ TIMESTAMP
  175. 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.
  176. .TP
  177. .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
  178. select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
  179. .TP
  180. .BI \-\-recompress \ MODE
  181. recompress data chunks according to \fIMODE\fP and \fB\-\-compression\fP\&. Possible modes are \fIif\-different\fP: recompress if current compression is with a different compression algorithm or different level; \fIalways\fP: recompress unconditionally; and \fInever\fP: do not recompress (use this option explicitly to prevent recompression). If no MODE is given, \fIif\-different\fP will be used. Not passing \-\-recompress is equivalent to \(dq\-\-recompress never\(dq.
  182. .TP
  183. .BI \-\-chunker\-params \ PARAMS
  184. 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
  185. .UNINDENT
  186. .SH EXAMPLES
  187. .INDENT 0.0
  188. .INDENT 3.5
  189. .sp
  190. .nf
  191. .ft C
  192. # Create a backup with little but fast compression
  193. $ borg create archive /some/files \-\-compression lz4
  194. # Then compress it \- this might take longer, but the backup has already completed,
  195. # so no inconsistencies from a long\-running backup job.
  196. $ borg recreate \-a archive \-\-recompress \-\-compression zlib,9
  197. # Remove unwanted files from all archives in a repository.
  198. # Note the relative path for the \-\-exclude option \- archives only contain relative paths.
  199. $ borg recreate \-\-exclude home/icke/Pictures/drunk_photos
  200. # Change archive comment
  201. $ borg create \-\-comment \(dqThis is a comment\(dq archivename ~
  202. $ borg info \-a archivename
  203. Name: archivename
  204. Fingerprint: ...
  205. Comment: This is a comment
  206. \&...
  207. $ borg recreate \-\-comment \(dqThis is a better comment\(dq \-a archivename
  208. $ borg info \-a archivename
  209. Name: archivename
  210. Fingerprint: ...
  211. Comment: This is a better comment
  212. \&...
  213. .ft P
  214. .fi
  215. .UNINDENT
  216. .UNINDENT
  217. .SH SEE ALSO
  218. .sp
  219. \fIborg\-common(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP
  220. .SH AUTHOR
  221. The Borg Collective
  222. .\" Generated by docutils manpage writer.
  223. .