Show HN: ZFS utils to mirror snapshots and apply retention
github.com
github.com
It would be fine to mention prior work and ask how this relates, or to ask what prompted the author to build something new. But a generic dismissal like "everyone tries to reinvent the wheel" is just a slap, and that goes against the culture we want here, especially in Show HN threads:
Why? Because ZFS backup and mirroring is going to be so system specific, that it is better left to one-off scripts written by the admin.
For example, your zfsu tx script - if I'm reading it right, you assumes that root can ssh from the backup server to the target server without a password. This is rarely the case (and I'd argue that it should never be the case). But, this is something that works on your systems...
The last time I had to setup ZFS snapshot mirroring, I did something similar, but it was so specific to my setup that it wasn't worth making it into a package that others would use. Each of the backup targets had a "backup" user with a password-less SSH key that could execute exactly one command with sudo (zfs send). That's not exactly something that lends itself to a simple install script.
Instead, it probably would be more beneficial to write a blog post somewhere that detailed why you needed these scripts, and the one or two magic lines in them that got the job done. The most I remember finding were the original Sun/Oracle ZFS docs.
Listen, this is hard and it sucks that there isn't a tool that comes with zfs to do this for you. But there are scripts that have been in production for years that have never failed. Scripts that are currently pushing hundreds of GBs per hour across the internet and recovering gracefully from failures. Use them. They work. They're even authored by zfs experts.
Yes, it's hard, but it's better to teach people how to manage it instead of giving them an unmodifiable tool and just say "here - use this". Telling them "here - do it like this", is much better.
ZFS has tools do execute the actual snapshots and to do the actual mirroring, but nothing to manage which snapshots to keep or how to actually reliably get a snapshot from one place to another.