borg-recreate.1 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH BORG-RECREATE 1 "2019-03-21" "" "borg backup tool"
  4. .SH NAME
  5. borg-recreate \- Re-create archives
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] recreate [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
  36. .SH DESCRIPTION
  37. .sp
  38. Recreate the contents of existing archives.
  39. .sp
  40. This is an \fIexperimental\fP feature. Do \fInot\fP use this on your only backup.
  41. .sp
  42. Important: Repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&.
  43. .sp
  44. \fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, \fB\-\-exclude\-if\-present\fP, \fB\-\-keep\-exclude\-tags\fP, and PATH
  45. have the exact same semantics as in "borg create". If PATHs are specified the
  46. resulting archive will only contain files from these PATHs.
  47. .sp
  48. Note that all paths in an archive are relative, therefore absolute patterns/paths
  49. will \fInot\fP match (\fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, PATHs).
  50. .sp
  51. \fB\-\-recompress\fP allows one to change the compression of existing data in archives.
  52. Due to how Borg stores compressed size information this might display
  53. incorrect information for archives that were not recreated at the same time.
  54. There is no risk of data loss by this.
  55. .sp
  56. \fB\-\-chunker\-params\fP will re\-chunk all files in the archive, this can be
  57. used to have upgraded Borg 0.xx or Attic archives deduplicate with
  58. Borg 1.x archives.
  59. .sp
  60. \fBUSE WITH CAUTION.\fP
  61. Depending on the PATHs and patterns given, recreate can be used to permanently
  62. delete files from archives.
  63. When in doubt, use \fB\-\-dry\-run \-\-verbose \-\-list\fP to see how patterns/PATHS are
  64. interpreted.
  65. .sp
  66. The archive being recreated is only removed after the operation completes. The
  67. archive that is built during the operation exists at the same time at
  68. "<ARCHIVE>.recreate". The new archive will have a different archive ID.
  69. .sp
  70. With \fB\-\-target\fP the original archive is not replaced, instead a new archive is created.
  71. .sp
  72. When rechunking (or recompressing), space usage can be substantial \- expect
  73. at least the entire deduplicated size of the archives using the previous
  74. chunker (or compression) params.
  75. .sp
  76. If you recently ran borg check \-\-repair and it had to fix lost chunks with all\-zero
  77. replacement chunks, please first run another backup for the same data and re\-run
  78. borg check \-\-repair afterwards to heal any archives that had lost chunks which are
  79. still generated from the input data.
  80. .sp
  81. Important: running borg recreate to re\-chunk will remove the chunks_healthy
  82. metadata of all items with replacement chunks, so healing will not be possible
  83. any more after re\-chunking (it is also unlikely it would ever work: due to the
  84. change of chunking parameters, the missing chunk likely will never be seen again
  85. even if you still have the data that produced it).
  86. .SH OPTIONS
  87. .sp
  88. See \fIborg\-common(1)\fP for common options of Borg commands.
  89. .SS arguments
  90. .INDENT 0.0
  91. .TP
  92. .B REPOSITORY_OR_ARCHIVE
  93. repository/archive to recreate
  94. .TP
  95. .B PATH
  96. paths to recreate; patterns are supported
  97. .UNINDENT
  98. .SS optional arguments
  99. .INDENT 0.0
  100. .TP
  101. .B \-\-list
  102. output verbose list of items (files, dirs, ...)
  103. .TP
  104. .BI \-\-filter \ STATUSCHARS
  105. only display items with the given status characters (listed in borg create \-\-help)
  106. .TP
  107. .B \-n\fP,\fB \-\-dry\-run
  108. do not change anything
  109. .TP
  110. .B \-s\fP,\fB \-\-stats
  111. print statistics at end
  112. .UNINDENT
  113. .SS Exclusion options
  114. .INDENT 0.0
  115. .TP
  116. .BI \-e \ PATTERN\fP,\fB \ \-\-exclude \ PATTERN
  117. exclude paths matching PATTERN
  118. .TP
  119. .BI \-\-exclude\-from \ EXCLUDEFILE
  120. read exclude patterns from EXCLUDEFILE, one per line
  121. .TP
  122. .BI \-\-pattern \ PATTERN
  123. experimental: include/exclude paths matching PATTERN
  124. .TP
  125. .BI \-\-patterns\-from \ PATTERNFILE
  126. experimental: read include/exclude patterns from PATTERNFILE, one per line
  127. .TP
  128. .B \-\-exclude\-caches
  129. exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.bford.info/cachedir/spec.html\fP)
  130. .TP
  131. .BI \-\-exclude\-if\-present \ NAME
  132. exclude directories that are tagged by containing a filesystem object with the given NAME
  133. .TP
  134. .B \-\-keep\-exclude\-tags
  135. if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive
  136. .UNINDENT
  137. .SS Archive options
  138. .INDENT 0.0
  139. .TP
  140. .BI \-\-target \ TARGET
  141. create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive)
  142. .TP
  143. .BI \-c \ SECONDS\fP,\fB \ \-\-checkpoint\-interval \ SECONDS
  144. write checkpoint every SECONDS seconds (Default: 1800)
  145. .TP
  146. .BI \-\-comment \ COMMENT
  147. add a comment text to the archive
  148. .TP
  149. .BI \-\-timestamp \ TIMESTAMP
  150. manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory.
  151. .TP
  152. .BI \-C \ COMPRESSION\fP,\fB \ \-\-compression \ COMPRESSION
  153. select compression algorithm, see the output of the "borg help compression" command for details.
  154. .TP
  155. .BI \-\-recompress \ MODE
  156. recompress data chunks according to \fB\-\-compression\fP\&. MODE \fIif\-different\fP: recompress if current compression is with a different compression algorithm (the level is not considered). MODE \fIalways\fP: recompress even if current compression is with the same compression algorithm (use this to change the compression level). MODE \fInever\fP (default): do not recompress.
  157. .TP
  158. .BI \-\-chunker\-params \ PARAMS
  159. specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the current defaults. default: buzhash,19,23,21,4095
  160. .UNINDENT
  161. .SH EXAMPLES
  162. .INDENT 0.0
  163. .INDENT 3.5
  164. .sp
  165. .nf
  166. .ft C
  167. # Make old (Attic / Borg 0.xx) archives deduplicate with Borg 1.x archives.
  168. # Archives created with Borg 1.1+ and the default chunker params are skipped
  169. # (archive ID stays the same).
  170. $ borg recreate /mnt/backup \-\-chunker\-params default \-\-progress
  171. # Create a backup with little but fast compression
  172. $ borg create /mnt/backup::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 /mnt/backup::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 /mnt/backup \-\-exclude home/icke/Pictures/drunk_photos
  179. # Change archive comment
  180. $ borg create \-\-comment "This is a comment" /mnt/backup::archivename ~
  181. $ borg info /mnt/backup::archivename
  182. Name: archivename
  183. Fingerprint: ...
  184. Comment: This is a comment
  185. \&...
  186. $ borg recreate \-\-comment "This is a better comment" /mnt/backup::archivename
  187. $ borg info /mnt/backup::archivename
  188. Name: archivename
  189. Fingerprint: ...
  190. Comment: This is a better comment
  191. \&...
  192. .ft P
  193. .fi
  194. .UNINDENT
  195. .UNINDENT
  196. .SH SEE ALSO
  197. .sp
  198. \fIborg\-common(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP
  199. .SH AUTHOR
  200. The Borg Collective
  201. .\" Generated by docutils manpage writer.
  202. .