Unifying systemd, sanoid.conf and syncoid:sync ZFS properties

Hi, I have several Sanoid and Syncoid configurations and jobs as well as systemd timers to trigger them, but it’s getting messy.

For example, I have local datasets that are recursively synced to my backup server, but I also have datasets which don’t need snapshots or backups (i.e. syncing their snapshots), so I have “overrides” for those datasets in sanoid.conf as well as syncoid:sync=false ZFS properties.

I also have some local datasets which are snapshotted and synced to another local pool, but the target pool obviously shouldn’t be snapshotted, so there’s another override in sanoid.conf.

This is all getting a bit messy and I’m starting to run into cases where I set up a new “replication” dataset where replication by Syncoid fails because there’s no Sanoid override and those snapshots already exist. This is all correct behaviour as configured - the issue is that I have 3 different places and systems to configure Sanoid and Syncoid. And then there are also my filesystem-level backups using restic/autorestic to be able to use exclude lists, but this forum isn’t the right place for that.

My question is: Are there ways to unify these configuration places to have a better overview about which datasets are getting snapshotted in which way, what’s syncing where, how it’s all scheduled, and ideally if a snapshot schedule and a sync schedule are colliding because Sanoid should never create snapshots on a receiving/replication dataset.

Thanks for reading! :slight_smile:

I am not an expert, just a fellow ZFS user here. See what others also have to say..

Snapshots are taken at source and then you can replicate them to as many targets as you want. As you probably know, you can control the frequency of snapshots at the dataset and/or pool level in your sanoid.conf file. For timing, I strictly use cron on local for local push replications, and cron on remote to handle pull replications.

Are you pushing or pulling your snapshots remotely?

If you’re pulling, then the things that affect that system are on that system, aren’t they?

I only have push configurations.

Overall, it seems like you’re trying to do --recursive but with lots of exceptions. Do the datasets you’re skipping replication have a common naming scheme, i.e. could you filter them using regex? If so, you could try the --exclude-datasets flag with syncoid.

Perhaps an broader exclude datasets option for sanoid would also be useful. A quick search on the issue tracker didn’t return any hits, if it would help your use case, you could try suggesting it in the sanoid issue tracker.

Edit: I took a brief look at the sanoid getchilddataset code, it shouldn’t be that hard to add an exclude in there. But I don’t know how it would interact with the rest of sanoid.