2
0

recreate.rst.inc 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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] [PATH...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``PATH`` | paths to recreate; patterns are supported |
  13. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | **options** |
  15. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | | ``--list`` | output verbose list of items (files, dirs, ...) |
  17. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--filter STATUSCHARS`` | only display items with the given status characters (listed in borg create --help) |
  19. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``-n``, ``--dry-run`` | do not change anything |
  21. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``-s``, ``--stats`` | print statistics at end |
  23. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | .. class:: borg-common-opt-ref |
  25. | |
  26. | :ref:`common_options` |
  27. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | **Include/Exclude options** |
  29. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  31. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  33. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
  35. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
  37. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) |
  39. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
  41. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive |
  43. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | **Archive filters** — Archive filters can be applied to repository targets. |
  45. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | | ``-a PATTERN``, ``--match-archives PATTERN`` | only consider archives matching all patterns. see "borg help match-archives". |
  47. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp |
  49. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | | ``--first N`` | consider first N archives after other filters were applied |
  51. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | | ``--last N`` | consider last N archives after other filters were applied |
  53. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | | ``--oldest TIMESPAN`` | consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m. |
  55. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | | ``--newest TIMESPAN`` | consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m. |
  57. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | | ``--older TIMESPAN`` | consider archives older than (now - TIMESPAN), e.g. 7d or 12m. |
  59. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | | ``--newer TIMESPAN`` | consider archives newer than (now - TIMESPAN), e.g. 7d or 12m. |
  61. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | | ``--target TARGET`` | create a new archive with the name ARCHIVE, do not replace existing archive |
  63. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | | ``--comment COMMENT`` | add a comment text to the archive |
  65. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | | ``--timestamp TIMESTAMP`` | 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. |
  67. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
  69. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | | ``--chunker-params PARAMS`` | rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk |
  71. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. .. raw:: html
  73. <script type='text/javascript'>
  74. $(document).ready(function () {
  75. $('.borg-options-table colgroup').remove();
  76. })
  77. </script>
  78. .. only:: latex
  79. PATH
  80. paths to recreate; patterns are supported
  81. options
  82. --list output verbose list of items (files, dirs, ...)
  83. --filter STATUSCHARS only display items with the given status characters (listed in borg create --help)
  84. -n, --dry-run do not change anything
  85. -s, --stats print statistics at end
  86. :ref:`common_options`
  87. |
  88. Include/Exclude options
  89. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  90. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  91. --pattern PATTERN include/exclude paths matching PATTERN
  92. --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
  93. --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html)
  94. --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
  95. --keep-exclude-tags if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive
  96. Archive filters
  97. -a PATTERN, --match-archives PATTERN only consider archives matching all patterns. see "borg help match-archives".
  98. --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
  99. --first N consider first N archives after other filters were applied
  100. --last N consider last N archives after other filters were applied
  101. --oldest TIMESPAN consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  102. --newest TIMESPAN consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m.
  103. --older TIMESPAN consider archives older than (now - TIMESPAN), e.g. 7d or 12m.
  104. --newer TIMESPAN consider archives newer than (now - TIMESPAN), e.g. 7d or 12m.
  105. --target TARGET create a new archive with the name ARCHIVE, do not replace existing archive
  106. --comment COMMENT add a comment text to the archive
  107. --timestamp TIMESTAMP 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.
  108. -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
  109. --chunker-params PARAMS rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk
  110. Description
  111. ~~~~~~~~~~~
  112. Recreate the contents of existing archives.
  113. recreate is a potentially dangerous function and might lead to data loss
  114. (if used wrongly). BE VERY CAREFUL!
  115. Important: Repository disk space is **not** freed until you run ``borg compact``.
  116. ``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags``
  117. and PATH have the exact same semantics as in "borg create", but they only check
  118. for files in the archives and not in the local file system. If PATHs are specified,
  119. the resulting archives will only contain files from these PATHs.
  120. Note that all paths in an archive are relative, therefore absolute patterns/paths
  121. will *not* match (``--exclude``, ``--exclude-from``, PATHs).
  122. ``--chunker-params`` will re-chunk all files in the archive, this can be
  123. used to have upgraded Borg 0.xx archives deduplicate with Borg 1.x archives.
  124. **USE WITH CAUTION.**
  125. Depending on the PATHs and patterns given, recreate can be used to
  126. delete files from archives permanently.
  127. When in doubt, use ``--dry-run --verbose --list`` to see how patterns/PATHS are
  128. interpreted. See :ref:`list_item_flags` in ``borg create`` for details.
  129. The archive being recreated is only removed after the operation completes. The
  130. archive that is built during the operation exists at the same time at
  131. "<ARCHIVE>.recreate". The new archive will have a different archive ID.
  132. With ``--target`` the original archive is not replaced, instead a new archive is created.
  133. When rechunking, space usage can be substantial - expect
  134. at least the entire deduplicated size of the archives using the previous
  135. chunker params.
  136. If your most recent borg check found missing chunks, please first run another
  137. backup for the same data, before doing any rechunking. If you are lucky, that
  138. will re-create the missing chunks. Optionally, do another borg check, to see
  139. if the chunks are still missing).