Hi all!
I presently manually perform replication pull from my backup server from my nas. Works great. I started exploring script options and either they are super elaborate or they seem out of date and do not work properly. One I liked that seemed simplistic that I tested was zxfer, however if I add -o readonly=on or -P it fails. From the github doesn't look like it's staying up to date with the newer versions of openzfs. I looked at others such as sanoid/syncoid, zrep, zrepl etc however they seem a bit elaborate. Openzfs has the native commands already, the more elaborate the more the chance in the future it doesn't work when Openzfs updates, also more room for another layer of bugs on top of zfs commands. Any suggestions on a simple replication script?
(Bonus, would like a diff log for the datasets as well automated preferably appended to one log)
This is my manual commands I ran initially then on going once a day:
#@backup server
This is the zxfer command I tried to execute however couldn't get it work with Freebsd 14
I presently manually perform replication pull from my backup server from my nas. Works great. I started exploring script options and either they are super elaborate or they seem out of date and do not work properly. One I liked that seemed simplistic that I tested was zxfer, however if I add -o readonly=on or -P it fails. From the github doesn't look like it's staying up to date with the newer versions of openzfs. I looked at others such as sanoid/syncoid, zrep, zrepl etc however they seem a bit elaborate. Openzfs has the native commands already, the more elaborate the more the chance in the future it doesn't work when Openzfs updates, also more room for another layer of bugs on top of zfs commands. Any suggestions on a simple replication script?
(Bonus, would like a diff log for the datasets as well automated preferably appended to one log)
This is my manual commands I ran initially then on going once a day:
Code:
#@nas server
zfs snapshot -r zpool0@$(date +%Y%m%d)
#@backup server
Code:
#first run
ssh 192.168.0.1 zfs send -LRPv zpool0@$(date +%Y%m%d) | zfs receive -o readonly=on zpool0/nas
#following runs
ssh 192.168.0.1 zfs send -RvI zpool0@$(date -v -1d +%Y%m%d) zpool0@$(date +%Y%m%d) | zfs receive zpool0/nas
#bonus diff each day!
zfs diff -HF zpool0@$(date -v -1d +%Y%m%d) zpool0@$(date +%Y%m%d) >> /var/log/zfs/zfs-diff-zpool0.$(date +%Y%m%d.log)
zfs diff -HF zpool0/dataset1@$(date -v -1d +%Y%m%d) zpool0/dataset1@$(date +%Y%m%d) >> /var/log/zfs/zfs-diff-zpool0-dataset1.$(date +%Y%m%d.log)
zfs diff -HF zpool0/dataset2@$(date -v -1d +%Y%m%d) zpool0/dataset2@$(date +%Y%m%d) >> /var/log/zfs/zfs-diff-zpool0-dataset2.$(date +%Y%m%d.log)
This is the zxfer command I tried to execute however couldn't get it work with Freebsd 14
Code:
zxfer -Pv -O 192.168.0.1 -o readonly=on -R zpool0 zpool0/nas