I’m using the Time Machine purpose with an SMB share created to be a Time Machine backup destination, and it works great (so far). (I’ve got some thoughts on the performance with the default dataset sync settings, but that’s for another post.)
I have it set to auto-generate a snapshot when it completes a Time Machine backup. Those are, of course, manual snapshots, so they’re set to live forever. Behold:
So, I need a way to manage these in an at least semi-automated way. I have a purging schedule in mind, but (quite reasonably), there’s not an obvious built-in way to auto-delete manual snapshots that are set to be immortal.
So, before I go about figuring out how to write a script to use the CLI to delete manual snapshots on a schedule using cron or something else that’s likely to lead to exciting adventures at my current skill level, is there a recommended way to automate this sort of thing?
@HoneyBadger , if there’s an existing solution to this, it might make for a fun segment on T3.
Thanks, @awasb ! That was exactly the utility that I assumed had to exist for manual snapshots.
Though, it sounds like from what @beagle said, the Time Machine snapshots will prune themselves. I’m on the seventh day now, so I expect to start seeing some tuning today or tomorrow. I’ll ping back here with what I observe.
Once I’ve confirmed that auto-pruning is happening on those, I’ll open an enhancement request on JIRA for the docs.
I’ve now observed snapshots older than 7 days getting purged.
I can’t find any mention of that in the docs.
@HoneyBadger Is JIRA still the best way to request open-ended documentation changes? (I wouldn’t hesitate if I had a specific idea what the documentation should say. At the moment I’m a bit overloaded and kind of stuck at the “please mention something about this?” phase. )
For Docs specifically, there’s a pull-tab at the far right of each page that’s a much simpler and JIRA-free way to submit feedback. Since it’s a documentation/writing workload and not an engineering workload, it gets to be a bit easier.
Thanks, @HoneyBadger . That is more convenient, and will make the engineers happier, too. I’ll try to submit something soon.
Snapshot pruning / deletion happens during SMB tree connect by the client.
@awalkerix That’s interesting. So, is it actually driven by the SMB/Time Machine client, or is it that the SMB service on the TN end of things detects the connection and runs a pruning operation?
I know Time Machine itself keeps its own snapshots inside the sparsebundle, and periodically deletes them. But, I assumed that Time Machine/SMB had no real idea it was backing up to a ZFS dataset over SMB, so the local Time Machine daemon/service wouldn’t be able to directly command ZFS to delete ZFS snapshots, because it would just see an SMB share.
I do heuristics on SMB operations being performed to trigger a read of the snapshot history plist in the sparsebundle file and determine whether a new time machine backup has been performed. If one has been performed then we take a snapshot.