Go to file
2020-02-10 17:59:54 -08:00
hooks Add multi-arch builds 2020-02-10 17:49:39 -08:00
tests Merge remote-tracking branch 'duplicity/health-check' into health-check 2019-02-01 14:00:45 -08:00
.dockerignore Clean test scripts 2018-05-13 10:31:31 -07:00
.gitignore Complete sample docker-compose.yaml 2019-02-01 17:03:34 -08:00
.travis.yml Update travis 2018-08-12 16:56:28 -07:00
backup.sh Add support for pre/post scripts 2019-01-28 11:59:46 -08:00
cron-exec.sh Fix env parsing for variables with spaces 2019-02-01 17:02:44 -08:00
docker-compose.yaml Complete sample docker-compose.yaml 2019-02-01 17:03:34 -08:00
Dockerfile Add multi-arch builds 2020-02-10 17:49:39 -08:00
healthcheck.sh Add healthcheck to Docker image 2019-02-01 13:48:00 -08:00
LICENSE Initial commit 2017-03-18 17:00:44 -07:00
Makefile Add multi-arch builds 2020-02-10 17:49:39 -08:00
multi-arch-manifest.yml Fix manifest tags 2020-02-10 17:59:54 -08:00
Readme.md Fix quotes on backup path and remove full sched 2018-08-18 19:12:31 -07:00
restore.sh Add support for pre/post scripts 2019-01-28 11:59:46 -08:00
start.sh Fix env parsing for variables with spaces 2019-02-01 17:02:44 -08:00
verify.sh Let's get restic in here 2018-08-12 16:53:06 -07:00

Restic Backup

Build Status

Instructions

Mount any directories you'd like to back up as a volume and run

Env Variables

Variable Default Description
AWS_ACCESS_KEY_ID Required for writing to S3 or Minio
AWS_SECRET_ACCESS_KEY Required for writing to S3 or Minio
B2_ACCOUNT_ID Required for writing to B2
B2_ACCOUNT_KEY Required for writing to B2
BACKUP_DEST /backups Destination to store backups (See restic documenation)
CLEANUP_COMMAND Optional restic arguments for forget to execute after backups to clean older ones out (eg. "--prune --keep-last 2"). See forget
CRON_SCHEDULE If you want to periodic incremental backups on a schedule, provide it here. By default we just backup once and exit
OPT_ARGUMENTS Any additional arguments to provide to the restic command
RESTIC_PASSWORD Passphrase to use for encryption
PATH_TO_BACKUP /data The path to the directory you wish to backup
RESTORE_ON_EMPTY_START Set this to "true" and if the $PATH_TO_BACKUP is empty, it will restore the latest backup. This can be used for auto recovery from lost data
SKIP_ON_START Skips backup on start if set to "true"
VERIFY_CRON_SCHEDULE If you want to verify your backups on a schedule, provide it here

Tips

Hostnames

Hostname is used for identifying what you are backing up. You may want to specify this on your container.

Backing up from another container

Mount all volumes from your existing container with --volumes-from and then back up by providing the paths to those volumes. If there are more than one volumes, you'll want to use the above tip for mulitple backup sources

Restoring a backup

On your running container, execute /restore.sh. That should be that! Eg. docker exec my_backup_container /restore.sh

To Do

  • Automatic restoration if there is no source data