Restic Backup Tool With Rclone For Cloud Bases Backups
1.8K
This repository builds a docker image containing the restic backup tool in combination with the rclone application. The container is intended for performing backups to and from cloud storage providers such as S3, Backblaze, Mega, etc.
To create the rclone configuration file to connect to your provider:
docker run -it --rm \
--entrypoint "/usr/bin/rclone"
-v ${PWD}/config:/home/user/.config/rclone \
geoffh1977/restic config
Run through the standard menu prompts in order to create the config file for rclone. When done there will be an rclone.conf file located in the target directory.
The following command is used to run the container and execute restic commands as the root user:
docker run -it --rm \
--hostname backup && \
-u 0 \
-e RESTIC_REPOSITORY=rclone:<PROVIDER>:<PATH> \
-e RESTIC_PASSWORD=<PASSWORD> \
-v <DATA TO BACKUP>:/data:ro \
-v ${PWD}/config:/root/.config/rclone:ro \
-v ${PWD}/cache:/cache \
geoffh1977/restic
Restic is set as the Entrypoint of the container, so commands can be executed without specifying the restic command on the command line.
It is also important to note this command will run the container as the root user. This is used for large data backups on servers containing user/group ids from multiple users.
N.B. The data path is only required when an actual backup is being performed. Other commands (i.e. snapshots or dump for example) do not need the data path mapped.
If the data being backed up is all located under a single user/group id, the container can be run as a normal user with the following command (UID is set to 1000):
docker run -it --rm \
--hostname backup && \
-e RESTIC_REPOSITORY=rclone:<PROVIDER>:<PATH> \
-e RESTIC_PASSWORD=<PASSWORD> \
-v <DATA TO BACKUP>:/data:ro \
-v ${PWD}/config:/home/user/.config/rclone:ro \
-v ${PWD}/cache:/cache \
geoffh1977/restic
Content type
Image
Digest
sha256:28a049ec6…
Size
36.8 MB
Last updated
almost 2 years ago
docker pull geoffh1977/restic