zfsbackup-go is a utility that can be used to backup ZFS snapshots to cloud storage such as Google, Amazon or B2. This is a handy way to get offsite backups if you're already using ZFS snapshots to back up your data.
I'm using zfsbackup-go to back up my existing SmartOS(illumos) ZFS snapshots offsite to BackBlaze B2. There were a few little tweaks that needed to be made to get things built and working on SmartOS; the B2 parts are not SmartOS specific and are mostly down to less than stellar documentation.
pkgin in go113
ln -s /opt/local/bin/go113 /opt/local/bin/go
GOPATH=/root/go
export GOPATH
go get https://github.com/someone1/zfsbackup-go
I had a minor compilation problem with one or two of the dependencies, but it was easy to fix:
Add solaris to the list of build platforms in:
$GOPATH/go/pkg/mod/github.com/mattn/go-ieproxy@v0.0.0-20190610004146-91bb50d98149/ieproxy_unix.goand
$GOPATH/go/src/github.com/Azure/azure-storage-blob-go/azblob/zc_mmf_unix.go
Additionally, in zc_mmf_unix.go, change the import of "syscall" to "golang.org/x/sys/unix" and change all the syscall references to unix.
pkgin in mozilla-rootcerts ln -s /opt/local/etc/openssl/ca-certificates.crt \ /etc/ssl/certs/ca-certificates.crt
You'll need to set two environment variables containing your B2 account and key information. There's surprisingly little information about what these values are, so after extensive trial and error, here's where they seem to come from:
B2_ACCOUNT_ID=myKeyID \ B2_ACCOUNT_KEY=myApplicationKey \ /opt/zfsbackup-go send --full -R \ --encryptTo myPGPKey@myDomain \ --signFrom myPGPKey@myDomain \ --publicKeyRingPath /zones/images/zfsbackup.pub \ --secretKeyRingPath /zones/images/zfsbackup.priv
--logLevel debug \ --workingDirectory /zones/images/.zfsbackup \ zones b2://hostA-backup-2019/zones