1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-29 11:16:43 +00:00
borg/docs/usage/rcreate.rst.inc

176 lines
13 KiB
PHP
Raw Normal View History

2016-07-05 21:30:08 +00:00
.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
2022-06-23 23:19:19 +00:00
.. _borg_rcreate:
2022-06-23 23:19:19 +00:00
borg rcreate
------------
.. code-block:: none
2022-06-23 23:19:19 +00:00
borg [common options] rcreate [options]
2017-06-20 13:22:24 +00:00
.. only:: html
.. class:: borg-options-table
2019-02-24 19:39:42 +00:00
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2022-11-26 21:23:17 +00:00
| **options** |
2019-02-24 19:39:42 +00:00
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2022-06-23 23:19:19 +00:00
| | ``--other-repo SRC_REPOSITORY`` | reuse the key material from the other repository |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2019-02-24 19:39:42 +00:00
| | ``-e MODE``, ``--encryption MODE`` | select encryption key mode **(required)** |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--append-only`` | create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--storage-quota QUOTA`` | Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| | ``--make-parent-dirs`` | create the parent directories of the repository directory, if they are missing. |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2022-08-07 17:20:34 +00:00
| | ``--copy-crypt-key`` | copy the crypt_key (used for authenticated encryption) from the key of the other repo (default: new random key). |
2022-08-03 20:19:12 +00:00
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2019-02-24 19:39:42 +00:00
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2017-06-20 13:22:24 +00:00
.. raw:: html
<script type='text/javascript'>
$(document).ready(function () {
2017-06-20 13:22:24 +00:00
$('.borg-options-table colgroup').remove();
})
</script>
.. only:: latex
2022-11-26 21:23:17 +00:00
options
2022-06-23 23:19:19 +00:00
--other-repo SRC_REPOSITORY reuse the key material from the other repository
2017-07-23 15:12:01 +00:00
-e MODE, --encryption MODE select encryption key mode **(required)**
2019-02-24 19:39:42 +00:00
--append-only create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details.
2017-07-23 15:12:01 +00:00
--storage-quota QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
2019-02-24 19:39:42 +00:00
--make-parent-dirs create the parent directories of the repository directory, if they are missing.
2022-08-07 17:20:34 +00:00
--copy-crypt-key copy the crypt_key (used for authenticated encryption) from the key of the other repo (default: new random key).
2017-06-20 13:22:24 +00:00
:ref:`common_options`
|
Description
~~~~~~~~~~~
2022-06-23 23:19:19 +00:00
This command creates a new, empty repository. A repository is a filesystem
directory containing the deduplicated data from zero or more archives.
2016-07-05 23:33:53 +00:00
2022-02-19 17:47:47 +00:00
Encryption mode TLDR
++++++++++++++++++++
2016-07-05 23:33:53 +00:00
2022-04-14 19:09:23 +00:00
The encryption mode can only be configured when creating a new repository - you can
neither configure it on a per-archive basis nor change the mode of an existing repository.
This example will likely NOT give optimum performance on your machine (performance
tips will come below):
2016-07-05 23:33:53 +00:00
2022-04-14 19:09:23 +00:00
::
2020-04-21 20:56:55 +00:00
2022-06-23 23:19:19 +00:00
borg rcreate --encryption repokey-aes-ocb
2016-07-05 23:33:53 +00:00
2022-02-19 17:47:47 +00:00
Borg will:
1. Ask you to come up with a passphrase.
2022-04-14 19:09:23 +00:00
2. Create a borg key (which contains some random secrets. See :ref:`key_files`).
3. Derive a "key encryption key" from your passphrase
4. Encrypt and sign the key with the key encryption key
5. Store the encrypted borg key inside the repository directory (in the repo config).
2022-02-19 17:47:47 +00:00
This is why it is essential to use a secure passphrase.
2022-04-14 19:09:23 +00:00
6. Encrypt and sign your backups to prevent anyone from reading or forging them unless they
2022-02-19 17:47:47 +00:00
have the key and know the passphrase. Make sure to keep a backup of
your key **outside** the repository - do not lock yourself out by
"leaving your keys inside your car" (see :ref:`borg_key_export`).
2022-08-03 20:19:12 +00:00
The encryption is done locally - if you use a remote repository, the remote machine
2022-02-19 17:47:47 +00:00
never sees your passphrase, your unencrypted key or your unencrypted files.
Chunking and id generation are also based on your key to improve
your privacy.
2022-04-14 19:09:23 +00:00
7. Use the key when extracting files to decrypt them and to verify that the contents of
2022-02-19 17:47:47 +00:00
the backups have not been accidentally or maliciously altered.
Picking a passphrase
++++++++++++++++++++
2016-07-05 23:33:53 +00:00
Make sure you use a good passphrase. Not too short, not too simple. The real
encryption / decryption key is encrypted with / locked by your passphrase.
If an attacker gets your key, he can't unlock and use it without knowing the
passphrase.
Be careful with special or non-ascii characters in your passphrase:
- Borg processes the passphrase as unicode (and encodes it as utf-8),
so it does not have problems dealing with even the strangest characters.
- BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
So better use a long passphrase made from simple ascii chars than one that
includes non-ascii stuff or characters that are hard/impossible to enter on
a different keyboard layout.
You can change your passphrase for existing repos at any time, it won't affect
the encryption/decryption key or other secrets.
2022-04-14 19:09:23 +00:00
Choosing an encryption mode
+++++++++++++++++++++++++++
2022-02-19 17:47:47 +00:00
2022-04-14 19:09:23 +00:00
Depending on your hardware, hashing and crypto performance may vary widely.
The easiest way to find out about what's fastest is to run ``borg benchmark cpu``.
2022-02-19 17:47:47 +00:00
2022-04-14 19:09:23 +00:00
`repokey` modes: if you want ease-of-use and "passphrase" security is good enough -
the key will be stored in the repository (in ``repo_dir/config``).
`keyfile` modes: if you want "passphrase and having-the-key" security -
2022-04-14 19:09:23 +00:00
the key will be stored in your home directory (in ``~/.config/borg/keys``).
2020-04-21 20:56:55 +00:00
2022-04-14 19:09:23 +00:00
The following table is roughly sorted in order of preference, the better ones are
in the upper part of the table, in the lower part is the old and/or unsafe(r) stuff:
2020-04-21 20:56:55 +00:00
.. nanorst: inline-fill
2022-08-03 20:19:12 +00:00
+-----------------------------------+--------------+----------------+--------------------+
| Mode (K = keyfile or repokey) | ID-Hash | Encryption | Authentication |
+-----------------------------------+--------------+----------------+--------------------+
| K-blake2-chacha20-poly1305 | BLAKE2b | CHACHA20 | POLY1305 |
+-----------------------------------+--------------+----------------+--------------------+
| K-chacha20-poly1305 | HMAC-SHA-256 | CHACHA20 | POLY1305 |
+-----------------------------------+--------------+----------------+--------------------+
| K-blake2-aes-ocb | BLAKE2b | AES256-OCB | AES256-OCB |
+-----------------------------------+--------------+----------------+--------------------+
| K-aes-ocb | HMAC-SHA-256 | AES256-OCB | AES256-OCB |
+-----------------------------------+--------------+----------------+--------------------+
| authenticated-blake2 | BLAKE2b | none | BLAKE2b |
+-----------------------------------+--------------+----------------+--------------------+
| authenticated | HMAC-SHA-256 | none | HMAC-SHA256 |
+-----------------------------------+--------------+----------------+--------------------+
| none | SHA-256 | none | none |
+-----------------------------------+--------------+----------------+--------------------+
.. nanorst: inline-replace
`none` mode uses no encryption and no authentication. You're advised NOT to use this mode
2022-04-14 19:09:23 +00:00
as it would expose you to all sorts of issues (DoS, confidentiality, tampering, ...) in
case of malicious activity in the repository.
If you do **not** want to encrypt the contents of your backups, but still want to detect
malicious tampering use an `authenticated` mode. It's like `repokey` minus encryption.
2023-09-14 13:52:08 +00:00
To normally work with ``authenticated`` repos, you will need the passphrase, but
there is an emergency workaround, see ``BORG_WORKAROUNDS=authenticated_no_key`` docs.
2022-08-03 20:19:12 +00:00
Creating a related repository
+++++++++++++++++++++++++++++
2023-09-14 13:52:08 +00:00
You can use ``borg rcreate --other-repo ORIG_REPO ...`` to create a related repository
that uses the same secret key material as the given other/original repository.
2022-08-03 20:19:12 +00:00
By default, only the ID key and chunker secret will be the same (these are important
for deduplication) and the AE crypto keys will be newly generated random keys.
2022-08-07 17:20:34 +00:00
Optionally, if you use ``--copy-crypt-key`` you can also keep the same crypt_key
2022-08-03 20:19:12 +00:00
(used for authenticated encryption). Might be desired e.g. if you want to have less
keys to manage.
Creating related repositories is useful e.g. if you want to use ``borg transfer`` later.