bolthole / zrep

ZREP ZFS based replication and failover script from bolthole.com
Other
251 stars 57 forks source link

add check-for-remote parameter #184

Open crispyduck00 opened 2 years ago

crispyduck00 commented 2 years ago

As mentioned in another ticket, it would be a useful feature (at least for me) to do nothing and exit instead of doing local snapshots when remotehost not available or remotemaster. I think to not break things for others this needs to be added via a parameter or a own value in the config file.

Maybe a good place to add it is after the local master check:

        check=`$ZFSGETLVAL ${ZREPTAG}:master $srcfs`
        if [[ "$check" != "yes" ]] ; then
            zrep_errquit $srcfs not master. Cannot sync
        fi

I am doing it for me actually only in zrep_sync, to not create infinite snapshots when remote host is not available or split brain is detected.

ppbrown commented 2 years ago

Note to self: flag on ZREP_REQUIRE_REMOTE ?