backup-bot-two/README.md

1.1 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

TODO

  • Make a Docker image of this
  • Rip out or improve Restic stuff
  • Add secret handling for database backups
  • Continuous linting with shellcheck

Label format

(Haven't done secrets yet, here are two options)

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/"

Questions:

  • Should frequency be configurable per service, centrally, or both?
- "backupbot.backup.at: "* * * * *"