Yes; it’s a samba extension originally developed by IXSystems for TrueNAS Core: https://github.com/truenas/samba/blob/stable/dragonfish/source3/modules/vfs_tmprotect.c
As a fellow synology user I’m sure you have probably seen that “To improve reliably of backup Time Machine needs to start over” when using synology as Time Machine target – because their samba port was constantly broken and resulting in corrupted bundle way too often. Most people attribute this to “ah, Time Machine is flaky” when in reality no, it’s a misconfigured/broken samba that advertises features it does not fully support.
Anyway, that reputation led IXSystem to develop an extension, that essentially
- watches for mount events of the share where time machine bundle resides
- on successful connection reads SnapshotHistory.plist and fetches timestamp of last successful backup
- on share unmount reads that file again, and compares new successful timestamp with the original. If it’s newer by more than 900 seconds – it creates a snapshot (via libzfs wrapper).
That way if bundle does get corrupted – you just roll back the whole dataset (or sub volume, in case of btrfs).
Ironically, time machine on truenas never corrupted the backup – because IXSystems knows how to configure samba properly – so I did not get to use the extension for the intended purpose – but the snapshots themselves turned out to be very usable for zrepl to replicate.
TruenNAS Core 13.3 is unfortunately the very last version, and the product was discontinued. I’m slowly migrating my NAS to current stock FreeBSD, (not because it does not work, it’s very stable actually, but because installing software into or updating jails becomes a huge hassle since upstream FreeBSD repositories are getting retired) and so I ported this extension (imagine that, before the agentic coding tools! now it would have be a 10 min job).
I’m quite sure it would be feasible to adapt it to btrfs too, if really needed. I don’t know however if it is possible to build for DSM – synology does publish some source, but I’m pretty sure it’s unusable – because why would it be, its’ synology we are talkiing about.
I don’t own the remote server. I barter with a friend: we replicate snapshots to each other 