Backup Bot II: This Time It's Easily Configurable
Go to file
3wc 451c511554
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build encountered an error Details
2023-09-28 10:18:18 +01:00
.drone.yml fix push docker image to correct destination 2021-11-16 12:14:21 +01:00
.env.sample More HTTPS fixes 2023-09-19 15:45:37 +01:00
.envrc.sample add to .envrc.sample 2023-09-26 16:43:57 +02:00
.gitignore Ignore testing folder 2021-11-22 14:25:56 +02:00
Dockerfile chore(deps): update docker docker tag to v24.0.6 2023-09-06 07:03:13 +00:00 Merge branch 'main' into multi_path 2021-11-24 10:29:27 +00:00 Hopefully fix REMOVE_BACKUP_VOLUME_AFTER_UPLOAD 2023-09-28 10:18:18 +01:00
compose.https.yml More HTTPS fixes 2023-09-19 15:45:37 +01:00
compose.s3.yml Work-in-progress: split S3 & SSH storage 2021-11-09 12:37:56 +02:00
compose.ssh.yml Working cron again, d'oh 2021-11-11 02:10:17 +02:00
compose.swarm-cronjob.yml fix typo 2021-11-16 11:43:47 +01:00
compose.yml feat: backupvolume can be pruned after upload 2023-03-01 13:29:00 +01:00
renovate.json chore(deps): add renovate.json 2023-01-18 17:24:09 +00:00 Revert to previous, probably-working cron set-up 2021-11-11 12:05:04 +02:00

Backupbot II

Build Status

This Time, It's Easily Configurable

Automatically take backups from running Docker Swarm services into a volume.


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

  • 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 help, by

  1. letting you define backups using Docker labels, so you can easily collect your backups for use with another system like docker-volume-backup.
  2. running pre- and post-commands before and after backups, for example to use database tools to take a backup from a running service.


With Co-op Cloud

  1. Set up Docker Swarm and abra
  2. abra app new backup-bot-two
  3. abra app config <your-app-name>, and set storage options. Either configure CRON_SCHEDULE, or set up swarm-cronjob
  4. abra app secret generate <your-app-name> restic-password v1, optionally with --pass before <your-app-name> to save the generated secret in pass.
  5. abra app secret insert <your-app-name> ssh-key v1 ... or similar, to load required secrets.
  6. abra app deploy <your-app-name>
  • Category: Utilities
  • Status: 0, work-in-progress
  • Image: thecoopcloud/backup-bot-two, 4, upstream
  • Healthcheck: No
  • Backups: N/A
  • Email: N/A
  • Tests: No
  • SSO: N/A


Like Traefik, or swarm-cronjob, Backupbot II uses access to the Docker socket to read labels from running Docker Swarm services:

        backupbot.backup: "true"
        backupbot.backup.pre-hook: 'mysqldump -u root -p"$(cat /run/secrets/db_root_password)" -f /tmp/dump/dump.db' "rm -rf /tmp/dump/dump.db"
        backupbot.backup.path: "/tmp/dump/,/etc/foo/"
  • backupbot.backup -- set to true to back up this service (REQUIRED)
  • backupbot.backup.path -- comma separated list of file paths within the service to copy (REQUIRED)
  • backupbot.backup.pre-hook -- command to run before copying files (optional)
  • -- command to run after copying files (optional)

As in the above example, you can reference Docker Secrets, e.g. for looking up database passwords, by reading the files in /run/secrets directly.


  1. Install direnv
  2. cp .envrc.sample .envrc
  3. Edit .envrc as appropriate, including setting DOCKER_CONTEXT to a remote Docker context, if you're not running a swarm server locally.
  4. Run ./ -- you can add the --skip-backup or --skip-upload options if you just want to test one other step