mirror of
https://github.com/borgbackup/borg.git
synced 2026-09-01 14:13:19 +02:00
- quickstart: no segments in borg2 (packs/unreferenced-objects wording); backend list is file:/rest: plus sftp/s3/b2; fix the example script's exit-code handling for BORG_EXIT_CODES=modern (highest-rc-wins ranked warnings 100..127 above errors 3..99 and the rc==1 warning branch was dead) with a severity classifier; regenerate the --stats and repo-list samples from real runs; make the prose repo path match the script's rest:// URL; typos; correct the repository model description (no manifest tracking blocks). - repository-urls: use rest:// in the BORG_REPO example (ssh:// is legacy-only, as the same file says). - file-systems: rewrite for packs (chunks are grouped into pack files of up to ~50 MB; compact works at pack granularity). - resources: borg repo-delete (not "delete repo", not server-side); replace the false "single-threaded, max 100% of one core" claim with the real multi-threaded cases (zstd, blake3, pack writer). - positional-arguments: drop borg1 repo::archive wording. - config: fix the --print_config example (must precede the subcommand) and the related prose. - usage_general.rst.inc (man intro): add the archive-specification and config includes that were only added to the usage variant when the two files diverged (oversight from the #4587 split; the archive-specification include uses :start-after: to avoid a duplicate label). - fix dead links: IEC binary prefixes (wikipedia anchor moved), paperkey.html in the borg 1.x changelog. - misc: update benchmark-crud commands to borg2 (with a note that the numbers are borg1-era); add a preamble to create_chunker-params noting it predates borg2/fastcdc. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
71 lines
2.8 KiB
PHP
71 lines
2.8 KiB
PHP
Configuration Precedence
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
From lowest to highest:
|
|
|
|
1. Defaults defined in the source code.
|
|
2. Default config file (``$BORG_CONFIG_DIR/default.yaml``).
|
|
3. ``--config`` file(s) (in the order given).
|
|
4. Full config environment variable: (``BORG_CONFIG``).
|
|
5. Environment variables (e.g. ``BORG_LOG_LEVEL``).
|
|
6. Command-line arguments in order left to right (might include config files).
|
|
|
|
Configuration files
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
Borg supports reading options from YAML configuration files. This is
|
|
implemented via `jsonargparse <https://jsonargparse.readthedocs.io/>`_
|
|
and works for all options that can also be set on the command line.
|
|
|
|
Default configuration file
|
|
``$BORG_CONFIG_DIR/default.yaml`` is loaded automatically on every Borg
|
|
invocation if it exists. You do not need to pass ``--config`` explicitly
|
|
for this file.
|
|
|
|
``--config PATH``
|
|
Load additional options from the YAML file at *PATH*.
|
|
Options in this file take precedence over the default config file but are
|
|
overridden by explicit command-line arguments. This option can be used
|
|
multiple times, with later files overriding earlier ones.
|
|
|
|
``--print_config``
|
|
Print the current effective configuration (all options in YAML format) to
|
|
stdout and exit. This reflects the merged result of the default config
|
|
file, any ``--config`` file, environment variables, and command-line
|
|
arguments. The output can be used as a starting point for a config file.
|
|
|
|
``--print_config`` is a common option, so it must be given *before* the
|
|
subcommand name — the subcommand's own options still show up in the output.
|
|
|
|
File format
|
|
Config files are YAML documents. Top-level keys are option names
|
|
(without leading ``--`` and with ``-`` replaced by ``_``).
|
|
Nested keys correspond to subcommands.
|
|
|
|
Example ``default.yaml``::
|
|
|
|
# apply to all borg commands:
|
|
log_level: info
|
|
show_rc: true
|
|
|
|
# options specific to "borg create":
|
|
create:
|
|
compression: zstd,3
|
|
stats: true
|
|
|
|
The top-level keys set options that are common to all commands (equivalent
|
|
to placing them before the subcommand on the command line). Keys nested
|
|
under a subcommand name (e.g. ``create:``) are only applied when that
|
|
subcommand is invoked.
|
|
|
|
``borgfs`` reads the same config files, but as it has no subcommands, it uses
|
|
the top-level keys and the keys of the ``mount:`` section (``borgfs`` is the
|
|
``borg mount`` command, and its keys win over the top-level ones); all other
|
|
subcommand sections are ignored.
|
|
|
|
.. note::
|
|
``--print_config`` shows the merged effective configuration and is a
|
|
convenient way to check what values Borg will actually use, and to
|
|
generate contents for your borg config file(s)::
|
|
|
|
borg --repo /backup/main --print_config create --compression zstd,3
|