aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 3b3a9314e8a18904abbf8d2c80093a9f2f2dee2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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:
```zsnap.toml
[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
```