I’m releasing what might be the last set of ZFS Automatic Snapshot & Backup tools on this blog! Don’t worry – the services aren’t going away, but some folks in the Desktop group are starting to looking more carefully at this stuff, so they might move to opensolaris.org as a project somewhere. More on that later.

I’ve got two new packages available now – the main changes in each are more GUI integration, just some simple zenity tools to allow users to configure the services without needing the command line, which will appear in the GNOME menu under “Administration” after install – you may need to pkill gnome-panel or logout to see the change.

I’m not happy with the rights model for these GUI tools (they run using gksu to root), but hopefully they’ll be replaced soon. I’ve also gone to more trouble to package these services properly, so installation/removal is much easier. More details below.

ZFS Automatic Snapshot Service 0.9

Apart from the GUI code being new, I’ve a few extra bits here:

  • Packaging – we now have a Makefile and build a package, called TIMFauto-snapshot for now. Suggestions on better package names welcome. These are just SVR4 packages – I haven’t had bandwidth to play with IPS yet, so beware the postinstall/preremove scripts!
  • Adding some pre-configured SMF instances of common use-cases, eg. daily, hourly, weekly and monthly snapshot schedules, so users don’t have to worry about creating a manifest for these.
  • The inclusion of a special “fs-name” value, “//” which makes the service look at the ZFS user property “com.sun:auto-snapshot:<label>” so that users can mark filesystems to be included in a given snapshot schedule without needing to touch the SMF properties. The pre-configured instances above use this.
  • Changing the timeout for the start and stop method to be infinite – the 10 second timout was occasionally causing the service to give up trying to start when lots of instances were on the system. Because of the way I’m adding cron entries, I need to serialize the startup for these instances, so that they can take longer than 10 seconds to start, depending on the number of instances you have. This isn’t ideal, so better suggestions are welcome. I think this may fix the problem you were seeing Siegfried, but I still haven’t been able to reproduce it exactly.
  • A user had commented that having “:” characters in the snapshot names makes them inaccessible from samba clients – so I’ve added a $SEP variable to the method script to allow administrators change this. I was in two minds as to whether enough people would want this that I should add it as a new SMF property instead, but for now, if you need this, just edit line 64 of the method script.

Check out the updated README for more information.

ZFS Automatic Backup Service 0.2

Not much has changed here – the GUI is the main addition, along with putting the service in it’s own package, the same caveats as per the auto snapshot service apply here – this package is currently called TIMFauto-backup.

Check out the updated README for more information.

Now, with the news out of the way, I’d like to ask for help. Given that both of these services are likely to get more attention in the future (the folks putting together Indiana think these would be really handy to have in the distro, which I’m really thrilled about) I want to see if we can get some more eyes on the code.

If there’s anyone out there who’d like to offer code-reviews of either of these services, I’d be really interested in hearing from you. I use these on a regular basis myself, and I know there’s quite a few folks out there who use them too, so they do work as intended (or at least have done so far, Murphy’s law dictates that these versions I’m releasing today will kick your cat and burn your house down!) – however, as far as I know they’ve never been code-reviewed, from either a high-level architectural point of view, or a nitty gritty “your indenting sucks” perspective.

Would these be candidates for the Desktop consolidation, or some other consolidation targeting Indiana, and perhaps even Solaris some day ? Certainly the automatic backup service is currently quite desktop oriented, but a scheduled snapshot service sounds like something we’d want on servers too – ON perhaps ? (I’m not sure how to initiate that decision-making process either way)

So please, all comments would be welcome – I can take it, and if it means scrapping these implementations altogether and going back to the drawing board, then this would be a really good time to find that out!

Now – you’ve read this far (thanks) – here’s the software. In each tarball, there’s a prebuilt “proto” directory containing the package (which is architecture neutral). To install, as root simply do:

# cd <install dir>/proto
# pgkadd -d <name of package>