I’m managing a bunch of repos for many servers, and accessing multiple from a single server.
I use both the $RESTIC_REPOSITORY
+ $RESTIC_PASSWORD_COMMAND
shell variables to change the command depending on which repo I’m working on. But wondering if there’s a way to not have to change $RESTIC_PASSWORD_COMMAND
every time, especially when I’m doing lots of manual experimentation and changing the -r
repo argument a lot.
i.e. Restic could give it an argument or set a shell variable itself that includes the path to the repo I’m accessing.
So let’s say I have a single shell script called get-any-restic-password.sh
that can take a repo path like /tmp/repo1.restic
and my script knows how to parse that path and return the password for repo1.restic
…
Then I could simply set this fixed variable up for Restic:
export RESTIC_PASSWORD_COMMAND="get-any-restic-password.sh _REPOPATH_"
And Restic would replace the _REPOPATH_
placeholder with whatever the repo path is, regardless of if it came from $RESTIC_REPOSITORY or a -r
argument.