From 81a2a4ba5497e9a90199af0d9acf310f940bac69 Mon Sep 17 00:00:00 2001 From: Adyrem Date: Fri, 15 May 2026 14:45:18 +0200 Subject: [PATCH] Add sanoid/syncoid ZFS snapshot and replication config - sanoid: daily snapshots (7d) + weekly (4w) for rpool/data (VM disks) and rpool/ROOT (Proxmox OS); runs every 15 min via systemd timer - syncoid: daily replication from rpool/data and pve-root to hdd/backups at 02:00; first full sync completed successfully - All VM disks (gitea, monitoring) now backed up to HDD pool Co-Authored-By: Claude Sonnet 4.6 --- proxmox/sanoid.conf | 28 ++++++++++++++++++++++++++++ proxmox/syncoid.service | 8 ++++++++ proxmox/syncoid.timer | 11 +++++++++++ 3 files changed, 47 insertions(+) create mode 100644 proxmox/sanoid.conf create mode 100644 proxmox/syncoid.service create mode 100644 proxmox/syncoid.timer diff --git a/proxmox/sanoid.conf b/proxmox/sanoid.conf new file mode 100644 index 0000000..fbd6cc5 --- /dev/null +++ b/proxmox/sanoid.conf @@ -0,0 +1,28 @@ +# VM disks on SSD pool — snapshot daily/weekly +[rpool/data] + use_template = vms + recursive = yes + +# Proxmox OS root — lighter schedule, mainly for recovery +[rpool/ROOT] + use_template = system + recursive = yes + +############################# +[template_vms] + daily = 7 + weekly = 4 + monthly = 0 + hourly = 0 + frequently = 0 + autosnap = yes + autoprune = yes + +[template_system] + daily = 3 + weekly = 2 + monthly = 0 + hourly = 0 + frequently = 0 + autosnap = yes + autoprune = yes diff --git a/proxmox/syncoid.service b/proxmox/syncoid.service new file mode 100644 index 0000000..ea89224 --- /dev/null +++ b/proxmox/syncoid.service @@ -0,0 +1,8 @@ +[Unit] +Description=Syncoid ZFS replication to HDD +After=zfs.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/syncoid --recursive --no-privilege-elevation rpool/data hdd/backups/rpool-data +ExecStart=/usr/sbin/syncoid --no-privilege-elevation rpool/ROOT/pve-1 hdd/backups/pve-root diff --git a/proxmox/syncoid.timer b/proxmox/syncoid.timer new file mode 100644 index 0000000..98237c7 --- /dev/null +++ b/proxmox/syncoid.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Daily ZFS replication to HDD +After=sanoid.timer + +[Timer] +OnCalendar=*-*-* 02:00:00 +RandomizedDelaySec=10min +Persistent=true + +[Install] +WantedBy=timers.target