Has anyone used syncoid to script replication of ZFS snapshots?

Status
Not open for further replies.

NASbox

Guru
Joined
May 8, 2012
Messages
650
Has anyone used syncoid to script replication of ZFS snapshots on FreeNAS?
( https://github.com/jimsalterjrs/sanoid/blob/master/syncoid )

FYI it's a huge perl script that uses zfs commands to do replication tasks. At first glance it looks like it could be really useful, but before I dig into it I was wondering if anyone had tried it. It seems automating snapshot replication is something many have asked for, but there aren't any really good answers (or maybe I've missed something).
 
Joined
Dec 2, 2015
Messages
730

NASbox

Guru
Joined
May 8, 2012
Messages
650
I'm curious - what do you need to do that isn't possible using the replication tools provided by FreeNAS?

Scripting.... I want to set up scripts that I can launch from the command line to clone selected datasets to a pools that I mount in a hot swap bay on /dev/ada3 for a removable backup.

@nightshade00013 sent me a reference for doing internal backups, but it's really best for just doing regular snapshot clones to pools that are always mounted. Anything else requires activating/deactivating profiles and is a bit error prone.

I am importing one of 4 different pools (whatever disk is in the hot swap) to the same device. My script will look for the name of the pool and then automatically selected the right datasets to backup. I guess I could even have a cron job look to see if a pool was mounted and backup appropriately, but given that manual mounting/unmounting of pools is required, I'll likely just start the job manually.

I get that FreeNAS is really aimed at an enterprise market where replication to another server is the way to go, but for SOHO/home use it's often a case of backup to a hotswap or don't backup at all.

I haven't used syncoid, but from my inital look at it, it appears to pretty much handle pool replication. It creates a snapsot, and zfs sends it to wherever it's needed (local/remote), and prunes excess snapshots etc.

Syncoid is a collection of (large) perl scripts, and the docs say it runs under FreeBSD, so it shouldn't be too hard to install. Was hoping someone may have gone down this path and can provide some input.
 

devnullius

Patron
Joined
Dec 9, 2015
Messages
289
I'm curious too :)
 
Status
Not open for further replies.
Top