A super simple docker volume backup meant for home servers and backing up to a local disk.
  • Rust 79.2%
  • Nix 18.1%
  • Dockerfile 2.7%
Find a file
insberr 9584313b6d
All checks were successful
ci/crow/push/docker-build Pipeline was successful
crowci works fine now : )
2026-06-27 10:43:09 -07:00
.crow yeah give up on that 2026-05-09 14:36:26 -07:00
.idea initial commit 2026-01-07 12:56:07 -08:00
src add hours and seconds to duration field 2026-06-25 23:08:29 -07:00
.envrc nix? how did i develop this before? 2026-06-23 16:07:15 -07:00
.gitignore nix? how did i develop this before? 2026-06-23 16:07:15 -07:00
Cargo.lock fix: those fuck ass signals 2026-06-21 00:53:14 +01:00
Cargo.toml fix: those fuck ass signals 2026-06-21 00:53:14 +01:00
Dockerfile i dont need this stuff? 2026-03-03 12:39:20 -08:00
flake.lock nix? how did i develop this before? 2026-06-23 16:07:15 -07:00
flake.nix nix? how did i develop this before? 2026-06-23 16:07:15 -07:00
mise.toml fix: skip the root dir 2026-02-25 23:31:48 +00:00
README.md update docs 2026-01-11 11:43:33 -08:00

Docker Volume Backup

I am using offen/docker-volume-backup:v2.46.1 which currently makes a zip into a temporary directory and then copies it to the backup location. This is not desirable since I dont have the storage space for it. I need something that just makes the zip directly to the desired backup location.

Features:

  • Set cron for when to backup
  • Discord webhook support
  • Keep the last x backups
  • storage space alerts

Usage

Here is a bare minimum example docker compose file:

services:
  docker-volume-backup:
    image: git.insberr.com/insberr/docker-volume-backup:latest
    volumes:
      - volume-to-backup:/source
      - /mnt/your-backups-folder:/backup
    environment:
      # Crontab schedule to run the backup on
      # https://crontab.guru/
      - SCHEDULE=50 11 * * *

or a one off backup:

docker run -d \
  --name docker-volume-backup \
  -v volume-to-backup:/source \
  -v /mnt/your-backups-folder:/backup \
  -e RUN_ONCE=true\
  git.insberr.com/insberr/docker-volume-backup:latest

Configuration

Environment variables

### REQUIRED ###

# Crontab schedule to run the backup on
SCHEDULE=50 11 * * *


### OPTIONAL ###

# Run once immedietly. If this value is provided, the `SCHEDULE` value is not required
RUN_ONCE=true

# Crontab schedule to run the backup on
DISCORD_WEBHOOK=<DISCORD_WEBHOOK_URL>

PREFIX=some-filename-prefix

# This will keep n backups (including the newly created backup)
# To keep all backups, simply remove the environment variable
KEEP_N=5

# The path that the source files are mounted to in the container
# Default is /source
SOURCE=/some/path/in/container

# The path that the backup tar.gz should be written to
# Default is /backup
DESTINATION=/some/path/in/container