From d57c9d2d52d6d26e5cd5965fcb8561c97fdc6441 Mon Sep 17 00:00:00 2001 From: Otho Date: Wed, 23 Nov 2022 22:57:23 -0500 Subject: [PATCH] Added test mode for zfs allow commands. --- backup.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index e764cee..2ca985a 100755 --- a/backup.sh +++ b/backup.sh @@ -66,14 +66,24 @@ get_latest_snapshot() setup_aggregator() { create_datasets - zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} + if [ $BG_TEST_MODE = "TRUE" ]; then + echo zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} + else + zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} + fi } setup_mirror() { - zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} - zfs allow -u ${BG_USER} \ - compression,mountpoint,receive,create,mount ${BG_ROOT} + if [ $BG_TEST_MODE = "TRUE" ]; then + echo zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} + echo zfs allow -u ${BG_USER} \ + compression,mountpoint,receive,create,mount ${BG_ROOT} + else + zfs allow -u ${BG_USER} send,snapshot,hold ${BG_ROOT} + zfs allow -u ${BG_USER} \ + compression,mountpoint,receive,create,mount ${BG_ROOT} + fi } create_snapshot()