Here’s a small update to the ZFS Automatic Snapshot SMF service first mentioned here. There’s a few bugfixes in this release, and a small feature addition.

The first bugfix is the one that
Dick kindly pointed out
– sorry about that, all working now.

The second was a bit more subtle. Every once in a while, when starting my machine, I noticed that although the snapshot service instances were all listed as online, with no errors in their logs, nothing was being snapshotted – the entries that should have been added to the system crontab on starting the service weren’t there.

It turns out that this was because I didn’t have any form of locking around my accessing the crontabs, so the service instances were stepping on each others toes: in this case, SMF was being too damned efficient and was starting all my instances in parallel (as it should! :-) The locking I’m using now probably isn’t the best – but let me know what you think. Seems to work fine.

I’ve also added a small feature – the addition of a “verbose” property for the instances, with the default setting being false. I have a recursive, rolling snapshot every 10 minutes on one of my filesystems, and I was getting tired of my system logs getting spammed all the time by my instance deleting older snapshots, so that’s made life a bit nicer.

As always, let me know if you’ve any feedback – I’m always interested in ways I can improve this service.

The new version is now available in zfs-auto-snapshot-0.8.tar.gz and I’ve updated the README with these changes.