Sign inSign up

vividboarder/docker-restic-cron

By vividboarder

Updated over 4 years ago

Automated Restic backups from Docker

Image
0

4.7K

vividboarder/docker-restic-cron repository overview

Restic Backup

Build Status

Instructions

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

Env Variables

VariableDefaultDescription
AWS_ACCESS_KEY_IDRequired for writing to S3 or Minio
AWS_SECRET_ACCESS_KEYRequired for writing to S3 or Minio
B2_ACCOUNT_IDRequired for writing to B2
B2_ACCOUNT_KEYRequired for writing to B2
BACKUP_DEST/backupsDestination to store backups (See restic documenation)
CLEANUP_COMMANDOptional restic arguments for forget to execute after backups to clean older ones out (eg. "--prune --keep-last 2"). See forget
CRON_SCHEDULEIf you want to periodic incremental backups on a schedule, provide it here. By default we just backup once and exit
OPT_ARGUMENTSAny additional arguments to provide to the restic command
RESTIC_PASSWORDPassphrase to use for encryption
PATH_TO_BACKUP/dataThe path to the directory you wish to backup
RESTORE_ON_EMPTY_STARTSet 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_STARTSkips backup on start if set to "true"
VERIFY_CRON_SCHEDULEIf 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

Backup to any rclone destination

This image also contains rclone. This allows you to target any destination supported by rclone. Check out the official documentation to see how to configure this.

Pre/post backup/restore scripts

Before and after any backup or restore, scripts located in /scripts/{backup,restore}/{before,after}/ will be executed. This can be used to do things like snapshotting a database before backing it up and restoring the contents.

Tag summary

Content type

Image

Digest

Size

23.9 MB

Last updated

over 5 years ago

docker pull vividboarder/docker-restic-cron