Is there any information out there on how to get started using Restic via a container? I am using the latest image, restic/restic
. Upon starting the container, it looks for a repository and fails with the below message:
Fatal: repository does not exist: unable to open config file: stat /test/config: no such file or directory
Is there a repository at the following location?
/test
The help/info I have searched for so far says that you have to make a repository first. I understand that, but how can I make one when the container fails to start up because it expects one?
When running the docker image using the command from github:
docker run --rm --hostname my-host -ti \
-v $HOME/.restic/passfile:/pass \
-v $HOME/importantdirectory:/data \
-e RESTIC_REPOSITORY=rest:https://user:pass@hostname/ \
restic/restic -p /pass backup /data
The parameters (-p /pass backup /data
) after the image are all flags from the manual.
The first command you want to run is:
docker run --rm --hostname my-host -ti \
-v $HOME/.restic/passfile:/pass \
-v $HOME/importantdirectory:/data \
-e RESTIC_REPOSITORY=rest:https://user:pass@hostname/ \
restic/restic -p /pass init
And then you can run backups using the Docker image via a script.
1 Like
Alternately I posted my docker compose file on this thread a few days ago. It uses a third party distribution, as far as I can recall (haven’t looked at it in a few months) the main thing that’s different is it adds cron to the linux image so you can have the container run in the background to do scheduled backups. It also supports pre and post backup commands, so for example you can export databases to a file and back that export up.