There must be something in your setup that makes restic run with both -r and --repository-file, and you need to find what it is.
You can set -x in your shell to see what commands are being run. Or you could perhaps check which restic is running and see if it’s a wrapper script that you are running, that adds the --repository-file option itself?
The code throwing that error message in restic 0.17.3 looks like this:
repo := opts.Repo
if opts.RepositoryFile != "" {
if repo != "" {
return "", errors.Fatal("Options -r and --repository-file are mutually exclusive, please specify only one")
}
My bet is on environment variable RESTIC_REPOSITORY_FILE set.
$ export RESTIC_REPOSITORY_FILE="bla bla bla"
$ restic -r rclone:RW01-ENC:rustic_kptsky_backup snapshots
Fatal: Options -r and --repository-file are mutually exclusive, please specify only one
Check it:
$ echo $RESTIC_REPOSITORY_FILE
bla bla bla
clear it:
$ unset RESTIC_REPOSITORY_FILE
or do not use -r flag.
Simply use one or another but not both at the same time.
Something very similar happened to me few weeks ago and it took me looong time (which does not look very smart in retrospect:)) to find the reason. Only why now “I know”