#22040·restic

[docs] Correct env/command param precedence

Author: fulldecentCreated Aug 30, 2026Updated Sep 6, 2026

Output of restic version

restic 0.19.0 compiled with go1.26.4 on darwin/arm64

What backend/service did you use to store the repository?

n/a

Problem description / Steps to reproduce

  1. Read documentation at 075_scripting.rst regarding whether RESTIC_REPOSITORY environmental variable or -r command flag will take precedence.
  2. Use the actual app

Expected behavior

  • ✅ App shows that -r takes precedence over RESTIC_REPOSITORY.
  • :x: Documentation shows that -r overrides RESTIC_REPOSITORY.

Proof

bash
export RESTIC_REPOSITORY="./tmp-env"
export RESTIC_PASSWORD="pass"
restic init -r ./tmp-param
created restic repository 6a91605391 at ./tmp-param

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.

❯ ls
tmp-param

Actual behavior

Documentation states that "RESTIC_REPOSITORY ... replaces -r".

Notes

  1. Please find all mentions of "replaces" in the documentation, there are multiple instances of this problem in this file, and perhaps in other files.
  2. Other parts of the documentation instead say the correct thing. Such as manual_rest.rst which says:

-r, --repo repository repository to backup to or restore from (default: $RESTIC_REPOSITORY)

  1. In 75_scripting, perhaps a clean fix is to say like:

RESTIC_REPOSITORY_FILE Name of file containing the repository location (overridden by --repository-file)

Do you have any idea what may have caused this?

Unintentional word choice, initially started at https://github.com/restic/restic/commit/df78896e59fc580d441ed10428832d7fae0ed3d1#diff-7d39a17a985c0d91907a249bab79adb98850521b3c30cd2ef221d1a5f93018a0R335-R336

Did restic help you today? Did it make you happy in any way?

Restic makes me happy every day, at exactly 2am!