Skip to content

Commit 556c909

Browse files
committed
Add sanoid
1 parent a7a06f2 commit 556c909

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

sanoid.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[template_os]
2+
hourly = 24 # 1 day of hourly snapshots
3+
daily = 7 # 1 week of daily
4+
weekly = 4 # 1 month of weekly
5+
monthly = 3 # 3 months of monthly
6+
autoprune = yes
7+
autosnap = yes
8+
9+
[template_media]
10+
daily = 30 # 30 daily snapshots
11+
monthly = 12 # 12 monthly
12+
yearly = 2 # 2 yearly
13+
autoprune = yes
14+
autosnap = yes
15+
16+
# Apply to datasets
17+
[zpcachyos]
18+
use_template = template_os
19+
recursive = yes
20+
21+
[media]
22+
use_template = template_media
23+
recursive = yes

sanoid.service

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=Sanoid ZFS Snapshot Manager
3+
Documentation=man:sanoid(8)
4+
5+
[Service]
6+
Type=oneshot
7+
ExecStart=/usr/sbin/sanoid
8+

sanoid.timer

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Run Sanoid every 15 minutes
3+
4+
[Timer]
5+
OnCalendar=hourly
6+
Persistent=yes
7+
RandomizedDelaySec=15m # stagger execution
8+
9+
[Install]
10+
WantedBy=timers.target
11+

scripts/nas.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ yay_install \
4343
cockpit-sensors \
4444
cockpit-zfs-manager \
4545
ntfy \
46-
resticprofile
46+
resticprofile \
47+
sanoid
4748

4849
sudo systemctl enable --now sshd
4950
sudo systemctl enable --now cockpit.socket

0 commit comments

Comments
 (0)