Configuration file for restic: crestic

Hello everyone!

I’m used to backup my data hard drive to 3 different restic repositories (local and remote).

I’d like to automate this with configuration files, i.e. I’d like to have something similar to the ssh utility where you can just use ssh target to connect to the target using the options specified in a configuration file for that specific target.

The most similar thing that I found is crestic. (I am not the author)
The reference issue is #16.

I’d like to see crestic or a similar ssh-like approach integrated into restic.
What do you think?

As you wrote and even linked to, there’s already an issue on GitHub that tracks this feature request.

Yeah, and the last comment in January was:

Since it hasn’t been done I did it, it seems there isn’t agreement and more discussion is needed

At this point in time I’d say more discussion isn’t needed, because we are already having a lot of other work to attend. When the time comes to add support for user-facing config files, there will be plenty of discussion if need be :slight_smile:

1 Like

Maybe move this thread to the recipes section where all the other restic wrappers have been introduced?

There is a fairly straightforward workaround. For a repository you want to call “foo,” create an executable file in /usr/local/bin named restic-foo with the following contents.


export RESTIC_REPOSITORY=/path/to/foo/repository
export RESTIC_PASSWORD=secret

exec restic "$@"

You can set appropriate permissions so that only some users can read the password and execute the script.

Then you just invoke restic-foo instead of restic.

For people preferring to set up an alias:

alias restic-foo='RESTIC_REPOSITORY=/path-to/foo-repo RESTIC_PASSWORD=secret restic'