backup-bot-two/README.md

1.3 KiB

Backupbot II: This Time It's Easily Configurable

Automatically backup files from running Docker Swarm services based on labels.

Background

There are lots of Docker volume backup systems; all of them have one or both of these problems:

  • You need to define all the volumes to back up in the configuration system
  • Backups require services to be stopped to take consistent copies

Backupbot II tries to solve these problems by letting you define how to back up your services using Docker labels, so you can easily collect your backups for use with another system like docker-volume-backup.

TODO

A first stab:

  • Make a Docker image of this
  • Add secret handling for database backups
  • SSH remote storage
    • Add SSH key handling
    • SSH host key checking
  • S3 remote storage
  • Re-add crond support

Future:

  • Continuous linting with shellcheck
  • Rip out or improve Restic stuff

Label format

services:
  db:
    deploy:
      labels:
        backupbot.backup: "true"
        backupbot.backup.repos: "$some_thing"
        backupbot.backup.at: "* * * * *"
        backupbot.backup.pre-hook: 'mysqldump -u root -p"$(cat /run/secrets/db_root_password)" -f /tmp/dump/dump.db'
        backupbot.backup.post-hook: "rm -rf /tmp/dump/dump.db"
        backupbot.backup.path: "/tmp/dump/"