recreate.rst.inc 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. .. _borg_recreate:
  2. borg recreate
  3. -------------
  4. ::
  5. borg recreate <options> REPOSITORY_OR_ARCHIVE PATH
  6. positional arguments
  7. REPOSITORY_OR_ARCHIVE
  8. repository/archive to recreate
  9. PATH
  10. paths to recreate; patterns are supported
  11. optional arguments
  12. ``--list``
  13. | output verbose list of items (files, dirs, ...)
  14. ``--filter STATUSCHARS``
  15. | only display items with the given status characters
  16. ``-p``, ``--progress``
  17. | show progress display while recreating archives
  18. ``-n``, ``--dry-run``
  19. | do not change anything
  20. ``-s``, ``--stats``
  21. | print statistics at end
  22. `Common options`_
  23. |
  24. Exclusion options
  25. ``-e PATTERN``, ``--exclude PATTERN``
  26. | exclude paths matching PATTERN
  27. ``--exclude-from EXCLUDEFILE``
  28. | read exclude patterns from EXCLUDEFILE, one per line
  29. ``--exclude-caches``
  30. | exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html)
  31. ``--exclude-if-present FILENAME``
  32. | exclude directories that contain the specified file
  33. ``--keep-tag-files``
  34. | keep tag files of excluded caches/directories
  35. Archive options
  36. ``--comment COMMENT``
  37. | add a comment text to the archive
  38. ``--timestamp yyyy-mm-ddThh:mm:ss``
  39. | manually specify the archive creation date/time (UTC). alternatively, give a reference file/directory.
  40. ``-C COMPRESSION``, ``--compression COMPRESSION``
  41. | select compression algorithm (and level):
  42. | none == no compression (default),
  43. | lz4 == lz4,
  44. | zlib == zlib (default level 6),
  45. | zlib,0 .. zlib,9 == zlib (with level 0..9),
  46. | lzma == lzma (default level 6),
  47. | lzma,0 .. lzma,9 == lzma (with level 0..9).
  48. ``--chunker-params CHUNK_MIN_EXP,CHUNK_MAX_EXP,HASH_MASK_BITS,HASH_WINDOW_SIZE``
  49. | specify the chunker parameters (or "default").
  50. Description
  51. ~~~~~~~~~~~
  52. Recreate the contents of existing archives.
  53. --exclude, --exclude-from and PATH have the exact same semantics
  54. as in "borg create". If PATHs are specified the resulting archive
  55. will only contain files from these PATHs.
  56. --compression: all chunks seen will be stored using the given method.
  57. Due to how Borg stores compressed size information this might display
  58. incorrect information for archives that were not recreated at the same time.
  59. There is no risk of data loss by this.
  60. --chunker-params will re-chunk all files in the archive, this can be
  61. used to have upgraded Borg 0.xx or Attic archives deduplicate with
  62. Borg 1.x archives.
  63. borg recreate is signal safe. Send either SIGINT (Ctrl-C on most terminals) or
  64. SIGTERM to request termination.
  65. Use the *exact same* command line to resume the operation later - changing excludes
  66. or paths will lead to inconsistencies (changed excludes will only apply to newly
  67. processed files/dirs). Changing compression leads to incorrect size information
  68. (which does not cause any data loss, but can be misleading).
  69. Changing chunker params between invocations might lead to data loss.
  70. USE WITH CAUTION.
  71. Depending on the PATHs and patterns given, recreate can be used to permanently
  72. delete files from archives.
  73. When in doubt, use "--dry-run --verbose --list" to see how patterns/PATHS are
  74. interpreted.
  75. The archive being recreated is only removed after the operation completes. The
  76. archive that is built during the operation exists at the same time at
  77. "<ARCHIVE>.recreate". The new archive will have a different archive ID.
  78. When rechunking space usage can be substantial, expect at least the entire
  79. deduplicated size of the archives using the previous chunker params.
  80. When recompressing approximately 1 % of the repository size or 512 MB
  81. (whichever is greater) of additional space is used.