Just a note since I do this. I have a freenas box that takes hourly snapshots. These snapshots are pruned such that I keep 1 snapshot per hour in the last day, 1 snapshot per day in the last 2 weeks, and 1 snapshot per week for the last year.
Separately I do restic backups. I run the restic backups only daily instead of hourly. Once per day, I take a zfs snapshot named @restic and clone the snapshot and mount it. Then I use restic to backup to the cloud. Finally, I clean up the temporary restic snapshots.
This is the core commands run by my script, though I do some extra stuff for cleanup and to only backup a subset of the data. I also prune once a week:
My zpool name is data1
zfs snapshot -r data1@restic
for SNAP in $(zfs list -o name -t snapshot | grep @restic)
do
CLONE=“data1/clone${SNAP:5:-7}”
zfs clone ${SNAP} ${CLONE}
donerestic -r repo backup --exclude-caches /mnt/data1/clone
zfs destroy -Rr data1@restic
Blockquote