borgbackup/docs/usage/extract.rst.inc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

126 lines
12 KiB
PHP
Raw Normal View History

2016-07-05 17:30:08 -04:00
.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_extract:
borg extract
------------
.. code-block:: none
2022-06-23 19:19:19 -04:00
borg [common options] extract [options] NAME [PATH...]
2017-06-20 09:22:24 -04:00
.. only:: html
2017-06-20 05:49:26 -04:00
2017-06-20 09:22:24 -04:00
.. class:: borg-options-table
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2022-06-23 19:19:19 -04:00
| | ``NAME`` | specify the archive name |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to extract; patterns are supported |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2025-04-21 15:07:46 -04:00
| **options** |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--list`` | output a verbose list of items (files, dirs, ...) |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not actually change any files |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--numeric-ids`` | only use numeric user and group identifiers |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2020-04-12 13:51:49 -04:00
| | ``--noflags`` | do not extract/set flags (e.g. NODUMP, IMMUTABLE) |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2021-05-11 16:33:55 -04:00
| | ``--noacls`` | do not extract/set ACLs |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--noxattrs`` | do not extract/set xattrs |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2017-07-23 11:12:01 -04:00
| | ``--stdout`` | write all extracted data to stdout |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--sparse`` | create holes in the output sparse file from all-zero chunks |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--continue`` | continue a previously interrupted extraction of the same archive |
2023-06-11 17:09:20 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2017-07-23 11:12:01 -04:00
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2023-06-11 17:09:20 -04:00
| **Include/Exclude options** |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2022-02-05 11:22:33 -05:00
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2022-02-05 11:22:33 -05:00
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
2017-07-23 11:12:01 -04:00
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
| | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. |
+-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+
2017-06-20 05:49:26 -04:00
2017-06-20 09:22:24 -04:00
.. raw:: html
2017-06-20 09:22:24 -04:00
<script type='text/javascript'>
$(document).ready(function () {
2017-06-20 09:22:24 -04:00
$('.borg-options-table colgroup').remove();
})
</script>
2017-06-20 09:22:24 -04:00
.. only:: latex
2022-06-23 19:19:19 -04:00
NAME
specify the archive name
2017-06-20 09:22:24 -04:00
PATH
paths to extract; patterns are supported
2025-04-21 15:07:46 -04:00
options
2025-12-23 12:00:09 -05:00
--list output a verbose list of items (files, dirs, ...)
2017-06-20 09:22:24 -04:00
-n, --dry-run do not actually change any files
2025-12-23 12:00:09 -05:00
--numeric-ids only use numeric user and group identifiers
2020-04-12 13:51:49 -04:00
--noflags do not extract/set flags (e.g. NODUMP, IMMUTABLE)
2021-05-11 16:33:55 -04:00
--noacls do not extract/set ACLs
--noxattrs do not extract/set xattrs
2017-06-20 09:22:24 -04:00
--stdout write all extracted data to stdout
2025-12-23 12:00:09 -05:00
--sparse create holes in the output sparse file from all-zero chunks
--continue continue a previously interrupted extraction of the same archive
2017-06-20 09:22:24 -04:00
:ref:`common_options`
|
2023-06-11 17:09:20 -04:00
Include/Exclude options
2017-07-23 11:12:01 -04:00
-e PATTERN, --exclude PATTERN exclude paths matching PATTERN
--exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
2022-02-05 11:22:33 -05:00
--pattern PATTERN include/exclude paths matching PATTERN
--patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
2017-07-23 11:12:01 -04:00
--strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
Description
~~~~~~~~~~~
2025-12-23 12:00:09 -05:00
This command extracts the contents of an archive.
2025-12-23 12:00:09 -05:00
By default, the entire archive is extracted, but a subset of files and directories
can be selected by passing a list of ``PATH`` arguments. The default interpretation
for the paths to extract is `pp:` which is a literal path-prefix match. If you want
to use e.g. a wildcard, you must select a different pattern style such as `sh:` or
`fm:`. See :ref:`borg_patterns` for more information.
The file selection can be further restricted by using the ``--exclude`` option.
2022-02-19 12:47:47 -05:00
For more help on include/exclude patterns, see the :ref:`borg_patterns` command output.
2016-07-05 19:33:53 -04:00
By using ``--dry-run``, you can do all extraction steps except actually writing the
2025-12-23 12:00:09 -05:00
output data: reading metadata and data chunks from the repository, checking the hash/HMAC,
decrypting, and decompressing.
2017-05-17 05:52:48 -04:00
``--progress`` can be slower than no progress display, since it makes one additional
2017-07-23 11:12:01 -04:00
pass over the archive metadata.
.. note::
Currently, extract always writes into the current working directory ("."),
2022-02-05 11:22:33 -05:00
so make sure you ``cd`` to the right place before calling ``borg extract``.
When parent directories are not extracted (because of using file/directory selection
2025-12-23 12:00:09 -05:00
or any other reason), Borg cannot restore parent directories' metadata, e.g., owner,
group, permissions, etc.