#backup-utility #backup #docker #command-line-tool #graceful-shutdown

app dockerbackup

This is a simple Docker backup tool. It allows you to automatically stop running containers and backup Docker volumes to local or remote destination.

6 releases (3 stable)

2.1.0 Sep 10, 2024
2.0.0 Aug 18, 2024
1.0.0 Aug 13, 2024
0.2.1 Jul 21, 2024
0.1.0 Mar 3, 2024

#1131 in Command line utilities

MIT/Apache

31KB
727 lines

About

This is a CLI tool for backing up Docker volumes.

Features

  • Stop running containers before backup
  • Restart containers after backup
  • Specify multiple local or remote ssh destinations and run backups in parallel
  • Send gotify or discord notifications with backup status
  • Cancel backups early with graceful shutdown
  • Exclude containers and volumes from backup

Building

Binary can be obtained by running:

cargo install dockerbackup

or by downloading one from the available releases.

Usage

Usage: dockerbackup [OPTIONS] --destination <dest_path>...

Options:
  -d, --destination <dest_path>...
          Backup destination path. This argument can be used multiple times and each path must be in the following format: [/backup or user@host:/backup, windows]. Target os must be specified with ssh paths.
      --volumes <volume_path>
          Path to docker volumes directory [default: /var/lib/docker/volumes]
      --exclude-containers <excluded_containers>...
          Containers to exclude from backup
      --exclude-volumes <excluded_volumes>...
          Volumes to exclude from backup
  -g, --gotify <gotify_url>
          Gotify server url for notifications
      --discord <discord_url>
          Discord webhook url for notifications
  -h, --help
          Print help
  -V, --version
          Print version

Dependencies

~11–29MB
~493K SLoC