aboutsummaryrefslogtreecommitdiff

zsnap

zsnap is a simple tool to manage periodic snapshots of zfs datasets.

Container image: cr.d464.sh/zsnap:latest

# run daemon
zsnap [--config zsnap.toml] run
# create a single snapshot for a given tag and dataset
zsnap [--config zsnap.toml] snapshot --tag my-tag dataset
# prune snapshots for a given tag and dataset
zsnap [--config zsnap.toml] prune [--tag my-tag] [--keep n] dataset

example service file:

[Unit]
Description=zsnap

[Service]
Type=simple
Environment="RUST_LOG=info"
ExecStart=/usr/bin/zsnap --config /etc/zsnap.toml run
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target

example config:

[dataset."blackmesa/k8s"]
schedules = ["hourly", "daily", "weekly", "monthly"]
recursive = true

[dataset."blackmesa/gitea"]
schedules = ["hourly", "daily", "weekly", "monthly"]

[schedule.hourly]
cron = "@hourly"
keep = 24

[schedule.daily]
cron = "@daily"
keep = 7

[schedule.weekly]
cron = "@weekly"
keep = 4

[schedule.monthly]
cron = "@monthly"
keep = 6