borgbackup/docs/usage/recreate.rst.inc

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

169 lines
26 KiB
PHP
Raw Normal View History

2016-07-05 19:33:53 -04:00
.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_recreate:
borg recreate
-------------
.. code-block:: none
2022-06-23 19:19:19 -04:00
borg [common options] recreate [options] [PATH...]
2017-06-20 09:22:24 -04:00
.. only:: html
.. class:: borg-options-table
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **positional arguments** |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``PATH`` | paths to recreate; patterns are supported |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-04-21 15:07:46 -04:00
| **options** |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--list`` | output verbose list of items (files, dirs, ...) |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--filter STATUSCHARS`` | only display items with the given status characters (listed in borg create --help) |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-n``, ``--dry-run`` | do not change anything |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-s``, ``--stats`` | print statistics at end |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Include/Exclude options** |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (https://www.bford.info/cachedir/spec.html) |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, do not omit the tag objects themselves from the backup archive |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **Archive filters** Archive filters can be applied to repository targets. |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``-a PATTERN``, ``--match-archives PATTERN`` | only consider archives matching all patterns. See "borg help match-archives". |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2024-10-03 06:23:03 -04:00
| | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--first N`` | consider the first N archives after other filters are applied |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--last N`` | consider the last N archives after other filters are applied |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--oldest TIMESPAN`` | consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g., 7d or 12m. |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--newest TIMESPAN`` | consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g., 7d or 12m. |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--older TIMESPAN`` | consider archives older than (now - TIMESPAN), e.g., 7d or 12m. |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2025-12-23 12:00:09 -05:00
| | ``--newer TIMESPAN`` | consider archives newer than (now - TIMESPAN), e.g., 7d or 12m. |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2024-09-26 01:57:01 -04:00
| | ``--target TARGET`` | create a new archive with the name ARCHIVE, do not replace existing archive |
2024-02-20 11:11:43 -05:00
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--comment COMMENT`` | add a comment text to the archive |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--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. |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--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 |
+-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2017-06-20 09:22:24 -04:00
.. raw:: html
<script type='text/javascript'>
$(document).ready(function () {
2017-06-20 09:22:24 -04:00
$('.borg-options-table colgroup').remove();
})
</script>
.. only:: latex
PATH
paths to recreate; patterns are supported
2025-04-21 15:07:46 -04:00
options
2017-06-20 09:22:24 -04:00
--list output verbose list of items (files, dirs, ...)
2017-07-23 11:12:01 -04:00
--filter STATUSCHARS only display items with the given status characters (listed in borg create --help)
2017-06-20 09:22:24 -04:00
-n, --dry-run do not change anything
-s, --stats print statistics at end
:ref:`common_options`
|
2023-06-11 17:09:20 -04:00
Include/Exclude options
2017-06-20 09:22:24 -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
--exclude-caches exclude directories that contain a CACHEDIR.TAG file (https://www.bford.info/cachedir/spec.html)
2017-06-20 09:22:24 -04:00
--exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME
2025-12-23 12:00:09 -05:00
--keep-exclude-tags if tag objects are specified with ``--exclude-if-present``, do not omit the tag objects themselves from the backup archive
2017-06-20 09:22:24 -04:00
2022-06-23 19:19:19 -04:00
Archive filters
2025-12-23 12:00:09 -05:00
-a PATTERN, --match-archives PATTERN only consider archives matching all patterns. See "borg help match-archives".
2024-10-03 06:23:03 -04:00
--sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
2025-12-23 12:00:09 -05:00
--first N consider the first N archives after other filters are applied
--last N consider the last N archives after other filters are applied
--oldest TIMESPAN consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g., 7d or 12m.
--newest TIMESPAN consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g., 7d or 12m.
--older TIMESPAN consider archives older than (now - TIMESPAN), e.g., 7d or 12m.
--newer TIMESPAN consider archives newer than (now - TIMESPAN), e.g., 7d or 12m.
2024-09-26 01:57:01 -04:00
--target TARGET create a new archive with the name ARCHIVE, do not replace existing archive
2024-09-07 16:31:48 -04:00
--comment COMMENT add a comment text to the archive
--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.
-C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
--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
2017-06-20 05:49:26 -04:00
Description
~~~~~~~~~~~
Recreate the contents of existing archives.
2025-12-23 12:00:09 -05:00
Recreate is a potentially dangerous function and might lead to data loss
2020-10-04 14:32:38 -04:00
(if used wrongly). BE VERY CAREFUL!
2016-12-13 21:42:38 -05:00
2018-07-12 16:00:19 -04:00
Important: Repository disk space is **not** freed until you run ``borg compact``.
2020-10-04 14:32:38 -04:00
``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags``
and PATH have the exact same semantics as in "borg create", but they only check
2025-12-23 12:00:09 -05:00
files in the archives and not in the local filesystem. If paths are specified,
the resulting archives will contain only files from those paths.
2016-08-27 18:17:24 -04:00
Note that all paths in an archive are relative, therefore absolute patterns/paths
2017-06-17 06:28:42 -04:00
will *not* match (``--exclude``, ``--exclude-from``, PATHs).
2016-08-27 18:17:24 -04:00
2017-06-17 06:28:42 -04:00
``--chunker-params`` will re-chunk all files in the archive, this can be
2022-07-17 03:23:06 -04:00
used to have upgraded Borg 0.xx archives deduplicate with Borg 1.x archives.
2017-06-09 13:22:18 -04:00
**USE WITH CAUTION.**
2025-12-23 12:00:09 -05:00
Depending on the paths and patterns given, recreate can be used to
delete files from archives permanently.
2025-12-23 12:00:09 -05:00
When in doubt, use ``--dry-run --verbose --list`` to see how patterns/paths are
2020-10-04 14:32:38 -04:00
interpreted. See :ref:`list_item_flags` in ``borg create`` for details.
The archive being recreated is only removed after the operation completes. The
archive that is built during the operation exists at the same time at
"<ARCHIVE>.recreate". The new archive will have a different archive ID.
2017-06-17 06:28:42 -04:00
With ``--target`` the original archive is not replaced, instead a new archive is created.
2016-08-27 18:17:24 -04:00
2024-02-20 11:11:43 -05:00
When rechunking, space usage can be substantial - expect
2018-07-12 16:00:19 -04:00
at least the entire deduplicated size of the archives using the previous
2024-02-20 11:11:43 -05:00
chunker params.
2025-04-21 15:07:46 -04:00
If your most recent borg check found missing chunks, please first run another
backup for the same data, before doing any rechunking. If you are lucky, that
2025-12-23 12:00:09 -05:00
will recreate the missing chunks. Optionally, do another borg check to see
if the chunks are still missing.