borg/docs/usage/repo-create.rst
Thomas Waldmann 5d0832d515
docs: fix outdated --encryption mode names in examples
"--encryption=none" and "--encryption=authenticated" have not existed since
the id hash became part of the mode name for the modes that do not encrypt:
they are now "none-sha256"/"none-blake3" and "authenticated-sha256"/
"authenticated-blake3". The examples in docs/usage/repo-create.rst still used
the old names, so copying them gave an argparse error.

The "authenticated --id-hash=blake3" example was doubly wrong: those modes
name their id hash themselves and reject a separate --id-hash. Replaced it
with plain "authenticated-blake3"/"none-blake3" examples and dropped the
now-wrong claim that the non-encrypting modes only support sha256.

Also:

- "--encryption=aes-ocb" (docs/usage/key.rst, docs/quickstart_example.rst.inc)
  is not a valid mode either, it is "aes256-ocb".
- scripts/rest_perf_test.sh used "--encryption none".
- regenerated the affected man pages; borg-repo-create(1) additionally picked
  up the already-fixed --key-location help text.

All examples were verified by actually running them.
2026-08-26 14:43:18 +02:00

36 lines
1.5 KiB
ReStructuredText

.. _borg_repo_create:
.. include:: repo-create.rst.inc
Examples
~~~~~~~~
::
# Local repository
$ export BORG_REPO=/path/to/repo
# Recommended AEAD cryptographic modes (key stored in the repository by default)
$ borg repo-create --encryption=aes256-ocb
$ borg repo-create --encryption=chacha20-poly1305
# No encryption (not recommended)
$ borg repo-create --encryption=authenticated-sha256
$ borg repo-create --encryption=none-sha256
# For the encrypted modes, --encryption (the cipher / AE algorithm) and --id-hash
# (the id hash function) are chosen independently. --id-hash defaults to sha256;
# use blake3 if it is faster on your hardware (run 'borg benchmark cpu' to find out).
$ borg repo-create --encryption=aes256-ocb --id-hash=blake3
$ borg repo-create --encryption=chacha20-poly1305 --id-hash=blake3
# The 'authenticated-*' and 'none-*' modes name their id hash themselves, so they
# do not take a separate --id-hash.
$ borg repo-create --encryption=authenticated-blake3
$ borg repo-create --encryption=none-blake3
# Where the key is stored (--key-location) is also chosen independently.
# --key-location defaults to repokey.
# repokey: stores the encrypted key inside the repository
$ borg repo-create --encryption=aes256-ocb --key-location=repokey
# keyfile: stores the encrypted key in the config dir's keys/ subdir
# (e.g. ~/.config/borg/keys/ on Linux, ~/Library/Application Support/borg/keys/ on macOS)
$ borg repo-create --encryption=aes256-ocb --key-location=keyfile