Poor mans backup solution.
Go to file
Djeeberjr 505d6d4d44
All checks were successful
continuous-integration/drone/push Build is passing
added postgress support
2022-03-20 21:06:53 +01:00
.dockerignore added dockerignore 2021-11-10 21:29:50 +01:00
.drone.yml drone file 2022-02-15 11:21:51 +01:00
.gitignore added restore 2022-03-14 20:26:20 +01:00
backup.sh added postgress support 2022-03-20 21:06:53 +01:00
docker-compose.yml made changes 2021-11-10 21:27:49 +01:00
Dockerfile added postgress support 2022-03-20 21:06:53 +01:00
interactive.sh made changes 2021-11-10 21:27:49 +01:00
README.md added postgress support 2022-03-20 21:06:53 +01:00
restore.sh added restore 2022-03-14 20:26:20 +01:00
setup.sh added postgress support 2022-03-20 21:06:53 +01:00

Use restic together with rclone for a poor mans backup solution.

Configuration

Environment variables:

RCLONE_REMOTE remote for rclone e.g. gdrive:/backup

RCLONE_CONFIG file path for the rclone config file e.g. /config/rclone.conf

RESTIC_PASSWORD or RESTIC_PASSWORD_FILE password for the repo

RCLONE_CONFIG_FILE content of the rclone config.

For the database:

MYSQL_DUMP_DB all databases comma sperated: db1,db2

MYSQL_HOST

MYSQL_USERNAME

MYSQL_PASSWORD or MYSQL_PASSWORD_FILE

POSTGRES_DUMP_DB all databases comma sperated: db1,db2

POSTGRES_HOST

POSTGRES_USERNAME

POSTGRES_PASSWORD or POSTGRES_PASSWORD_FILE

Use the /app/init.sh script to init a new remote.

Directorys

/config Contains the rclone config. /backup Contains the mounted volumes as read only /restore Contains volumes to restore

Usage

Here is an example of the script i use to backup my volumes:

#!/usr/bin/env sh
set -e 

# get all volumes with the "backup.enable" lable on it
BACKUP_VOL=$(docker volume ls --filter "label=backup.enable" --format '-v {{ .Name }}:/backup/{{ .Name }}:ro ')

docker run \
    --rm \
    -e "RCLONE_REMOTE=gdrive:/backup" \
    -e "RCLONE_CONFIG=/config/rclone.conf" \
    -e "ENC_PASSWORD=MyPassword" \
    -e "MYSQL_USERNAME=root" \
    -e "MYSQL_PASSWORD=dbPassword" \
    -e "MYSQL_DUMP_DB=db1,db2" \
    -e "MYSQL_HOST=databaseHost" \
    --network "dbNet" \
    -v "/var/docker/backup:/config" \
    $BACKUP_VOL \
    djeeberjr/backup