A super simple docker volume backup meant for home servers and backing up to a local disk.
Find a file
insberr 7847488750
All checks were successful
/ build (push) Successful in 44s
tweak webhook message
2026-01-16 00:46:50 -08:00
.forgejo/workflows done. bug free. everythiong works just fine 2026-01-07 17:07:00 -08:00
.idea initial commit 2026-01-07 12:56:07 -08:00
src tweak webhook message 2026-01-16 00:46:50 -08:00
.gitignore done. bug free. everythiong works just fine 2026-01-07 17:07:00 -08:00
Cargo.lock done. bug free. everythiong works just fine 2026-01-07 17:07:00 -08:00
Cargo.toml done. bug free. everythiong works just fine 2026-01-07 17:07:00 -08:00
Dockerfile done. bug free. everythiong works just fine 2026-01-07 17:07:00 -08: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