Sanoid not taking daily and monthly snapshots

Sanoid not taking daily and monthly snapshots

Weird one here. Hope someone can help

Proxmox 7.4-16

zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
rpool 952G 7.27G 945G - - 3% 0% 1.00x ONLINE -
storage 58.2T 6.93T 51.3T - - 3% 11% 1.00x ONLINE -
vms 3.48T 684G 2.82T - - 12% 19% 1.00x ONLINE -

Created vms/containers/test and a couple of test files

sanoid.conf

[vms/containers]
use_template = production
recursive = zfs

[template_production]
frequently = 0
hourly = 36
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes

Run sanoid

sanoid --cron --verbose
INFO: taking snapshots…
INFO: pruning snapshots…

Only hourly snapshots are created
zfs list -t snap vms/containers/test
NAME USED AVAIL REFER MOUNTPOINT
vms/containers/test@autosnap_2023-07-24_01:00:20_hourly 0B - 25K -
vms/containers/test@autosnap_2023-07-24_02:00:13_hourly 0B - 25K -

Any ideas why no daily or monthly snapshots are created?

Think I fixed it.

Changed
recursive = zfs
to
recursive = yes

You used recursive=zfs, which means newly created child datasets won’t get snapshots taken until the parent is due for a new snapshot. It’s presumably been less than a day since you created vms/containers/test, so the most recent daily (and monthly) for vms/containers is still correct, so you don’t get snapshots taken on vms/containers/test.

If you want more predictable behavior, change recursive=zfs to recursive=yes.