extract.rst.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_extract:
  3. borg extract
  4. ------------
  5. .. code-block:: none
  6. borg [common options] extract [options] NAME [PATH...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  12. | | ``NAME`` | specify the archive name |
  13. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  14. | | ``PATH`` | paths to extract; patterns are supported |
  15. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  16. | **options** |
  17. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  18. | | ``--list`` | output a verbose list of items (files, dirs, ...) |
  19. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  20. | | ``-n``, ``--dry-run`` | do not actually change any files |
  21. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  22. | | ``--numeric-ids`` | only use numeric user and group identifiers |
  23. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  24. | | ``--noflags`` | do not extract/set flags (e.g. NODUMP, IMMUTABLE) |
  25. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  26. | | ``--noacls`` | do not extract/set ACLs |
  27. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  28. | | ``--noxattrs`` | do not extract/set xattrs |
  29. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  30. | | ``--stdout`` | write all extracted data to stdout |
  31. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  32. | | ``--sparse`` | create holes in the output sparse file from all-zero chunks |
  33. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  34. | | ``--continue`` | continue a previously interrupted extraction of the same archive |
  35. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  36. | .. class:: borg-common-opt-ref |
  37. | |
  38. | :ref:`common_options` |
  39. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  40. | **Include/Exclude options** |
  41. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  42. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  43. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  44. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  45. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  46. | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
  47. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  48. | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
  49. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  50. | | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
  51. +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
  52. .. raw:: html
  53. <script type='text/javascript'>
  54. $(document).ready(function () {
  55. $('.borg-options-table colgroup').remove();
  56. })
  57. </script>
  58. .. only:: latex
  59. NAME
  60. specify the archive name
  61. PATH
  62. paths to extract; patterns are supported
  63. options
  64. --list output a verbose list of items (files, dirs, ...)
  65. -n, --dry-run do not actually change any files
  66. --numeric-ids only use numeric user and group identifiers
  67. --noflags do not extract/set flags (e.g. NODUMP, IMMUTABLE)
  68. --noacls do not extract/set ACLs
  69. --noxattrs do not extract/set xattrs
  70. --stdout write all extracted data to stdout
  71. --sparse create holes in the output sparse file from all-zero chunks
  72. --continue continue a previously interrupted extraction of the same archive
  73. :ref:`common_options`
  74. |
  75. Include/Exclude options
  76. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  77. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  78. --pattern PATTERN include/exclude paths matching PATTERN
  79. --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
  80. --strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
  81. Description
  82. ~~~~~~~~~~~
  83. This command extracts the contents of an archive.
  84. By default, the entire archive is extracted, but a subset of files and directories
  85. can be selected by passing a list of ``PATH`` arguments. The default interpretation
  86. for the paths to extract is `pp:` which is a literal path-prefix match. If you want
  87. to use e.g. a wildcard, you must select a different pattern style such as `sh:` or
  88. `fm:`. See :ref:`borg_patterns` for more information.
  89. The file selection can be further restricted by using the ``--exclude`` option.
  90. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output.
  91. By using ``--dry-run``, you can do all extraction steps except actually writing the
  92. output data: reading metadata and data chunks from the repository, checking the hash/HMAC,
  93. decrypting, and decompressing.
  94. ``--progress`` can be slower than no progress display, since it makes one additional
  95. pass over the archive metadata.
  96. .. note::
  97. Currently, extract always writes into the current working directory ("."),
  98. so make sure you ``cd`` to the right place before calling ``borg extract``.
  99. When parent directories are not extracted (because of using file/directory selection
  100. or any other reason), Borg cannot restore parent directories' metadata, e.g., owner,
  101. group, permissions, etc.