2
0

recreate.rst.inc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_recreate:
  3. borg recreate
  4. -------------
  5. .. code-block:: none
  6. borg [common options] recreate [options] [REPOSITORY_OR_ARCHIVE] [PATH...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``REPOSITORY_OR_ARCHIVE`` | repository/archive to recreate |
  13. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | | ``PATH`` | paths to recreate; patterns are supported |
  15. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | **optional arguments** |
  17. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--list`` | output verbose list of items (files, dirs, ...) |
  19. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``--filter STATUSCHARS`` | only display items with the given status characters (listed in borg create --help) |
  21. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``-n``, ``--dry-run`` | do not change anything |
  23. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | | ``-s``, ``--stats`` | print statistics at end |
  25. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | .. class:: borg-common-opt-ref |
  27. | |
  28. | :ref:`common_options` |
  29. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | **Exclusion options** |
  31. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  33. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  35. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN |
  37. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line |
  39. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
  41. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
  43. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
  45. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | **Archive options** |
  47. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | | ``--target TARGET`` | create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive) |
  49. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) |
  51. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | | ``--comment COMMENT`` | add a comment text to the archive |
  53. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. |
  55. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
  57. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | | ``--recompress MODE`` | recompress data chunks according to ``--compression``. MODE `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered). MODE `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level). MODE `never` (default): do not recompress. |
  59. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: buzhash,19,23,21,4095 |
  61. +-------------------------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. .. raw:: html
  63. <script type='text/javascript'>
  64. $(document).ready(function () {
  65. $('.borg-options-table colgroup').remove();
  66. })
  67. </script>
  68. .. only:: latex
  69. REPOSITORY_OR_ARCHIVE
  70. repository/archive to recreate
  71. PATH
  72. paths to recreate; patterns are supported
  73. optional arguments
  74. --list output verbose list of items (files, dirs, ...)
  75. --filter STATUSCHARS only display items with the given status characters (listed in borg create --help)
  76. -n, --dry-run do not change anything
  77. -s, --stats print statistics at end
  78. :ref:`common_options`
  79. |
  80. Exclusion options
  81. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  82. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  83. --pattern PATTERN experimental: include/exclude paths matching PATTERN
  84. --patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line
  85. --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html)
  86. --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
  87. --keep-exclude-tags if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive
  88. Archive options
  89. --target TARGET create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive)
  90. -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800)
  91. --comment COMMENT add a comment text to the archive
  92. --timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory.
  93. -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
  94. --recompress MODE recompress data chunks according to ``--compression``. MODE `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered). MODE `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level). MODE `never` (default): do not recompress.
  95. --chunker-params PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the current defaults. default: buzhash,19,23,21,4095
  96. Description
  97. ~~~~~~~~~~~
  98. Recreate the contents of existing archives.
  99. This is an *experimental* feature. Do *not* use this on your only backup.
  100. Important: Repository disk space is **not** freed until you run ``borg compact``.
  101. ``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags``, and PATH
  102. have the exact same semantics as in "borg create". If PATHs are specified the
  103. resulting archive will only contain files from these PATHs.
  104. Note that all paths in an archive are relative, therefore absolute patterns/paths
  105. will *not* match (``--exclude``, ``--exclude-from``, PATHs).
  106. ``--recompress`` allows one to change the compression of existing data in archives.
  107. Due to how Borg stores compressed size information this might display
  108. incorrect information for archives that were not recreated at the same time.
  109. There is no risk of data loss by this.
  110. ``--chunker-params`` will re-chunk all files in the archive, this can be
  111. used to have upgraded Borg 0.xx or Attic archives deduplicate with
  112. Borg 1.x archives.
  113. **USE WITH CAUTION.**
  114. Depending on the PATHs and patterns given, recreate can be used to permanently
  115. delete files from archives.
  116. When in doubt, use ``--dry-run --verbose --list`` to see how patterns/PATHS are
  117. interpreted.
  118. The archive being recreated is only removed after the operation completes. The
  119. archive that is built during the operation exists at the same time at
  120. "<ARCHIVE>.recreate". The new archive will have a different archive ID.
  121. With ``--target`` the original archive is not replaced, instead a new archive is created.
  122. When rechunking (or recompressing), space usage can be substantial - expect
  123. at least the entire deduplicated size of the archives using the previous
  124. chunker (or compression) params.
  125. If you recently ran borg check --repair and it had to fix lost chunks with all-zero
  126. replacement chunks, please first run another backup for the same data and re-run
  127. borg check --repair afterwards to heal any archives that had lost chunks which are
  128. still generated from the input data.
  129. Important: running borg recreate to re-chunk will remove the chunks_healthy
  130. metadata of all items with replacement chunks, so healing will not be possible
  131. any more after re-chunking (it is also unlikely it would ever work: due to the
  132. change of chunking parameters, the missing chunk likely will never be seen again
  133. even if you still have the data that produced it).