Anyone have any go-to choice for #FreeBSD scripts to handle zfs-send of snapshots for backup purposes? I have a couple of hosts using zfs and already have snapshots set up, but I would like to have the most recent snapshot sent to another host (and older snapshots to be pruned from that remote host).

Doesn't need to be anything super-fancy beyond that, bonus points for just integrating with periodic(8)

FreshPorts -- sysutils/py-zfs-autobackup: Periodicly backup zfs filesystems to other locations

This is a tool written to make replicating ZFS datasets easy and reliable. You can either use it as a backup tool, replication tool or snapshot tool. You can select what to backup by setting a custom ZFS property. This allows you to set and forget: Configure it so it backups your entire pool, and you never have to worry about backupping again. Even new datasets you create later will be backupped. Other settings are just specified on the commandline. This also makes it easier to setup and test zfs-autobackup and helps you fix all the issues you might encounter. When you're done you can just copy/paste your command to a cron or script. Since its using ZFS commands, you can see what its actually doing by specifying --debug. This also helps a lot if you run into some strange problem or error. You can just copy-paste the command that fails and play around with it on the commandline. (also something I missed in other tools) An important feature thats missing from other tools is a reliable --test option: This allows you to see what zfs-autobackup will do and tune your parameters. It will do everything, except make changes to your zfs datasets. Another nice thing is progress reporting: Its very useful with HUGE datasets, when you want to know how many hours/days it will take. zfs-autobackup tries to be the easiest to use backup tool for zfs.

I'm using zfs autobackup for about a year now and it does exactly that. It creates snapshots, keeps a defined number of them and sends them to another host of choice. It allows you to push or pull backups depending on your security model.

https://github.com/psy0rz/zfs_autobackup
GitHub - psy0rz/zfs_autobackup: ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. Easy to use and very reliable.

ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. Easy to use and very reliable. - psy0rz/zfs_autobackup

GitHub

@jamesoff

I use zrepl to do both the local and remote pruning of snapshots (e.g. hourly for a day, daily for a week, and so on) and syncing. It is quite configurable.

@david_chisnall @jamesoff I'm now reading https://zrepl.github.io/configuration/snapshotting.html

Any other suggested reading?

I just created a six disk ZFS raidz2 but I don't know much yet!

Taking Snaphots — zrepl documentation

@shapr @jamesoff

That’s all I read to configure zrepl. It was sufficient client for most things I did.

My NAS backs itself up also using zrepl, but where the remote disk is a second pool mounted over iSCSI (over WireGuard) from a remote machine (where it’s backed by a zvol), with GELI encryption underneath so the remote machine can’t see the contents of the backups. The remote machine also uses zrepl to snapshot the zvol, so I can roll back the backup to earlier versions if the NAS starts writing nonsense.

The iSCSI bit of this required a bit more config, but there was a helpful FreeBSD Journal article with some nice examples.

Responsible Replication with Zelta

YouTube
@jamesoff check out syncoid
@jamesoff someone has probably already said this, but @jimsalter 's Syncoid is brilliant

@paul @jamesoff syncoid gets as close as it can to recreating the look and feel of rsync, but using ZFS replication as the underlying engine.

It's part of the sanoid project. pkg add sanoid on FreeBSD. Feel free to come to https://discourse.practicalzfs.com/ if you want to get turbo nerdy and/or ask questions about that or anything else ZFS! 🍻🤠👍

Practical ZFS

A home for OpenZFS news, education, and discussion

Practical ZFS
@jamesoff only one I know of is ZnapZend!