From 6abf246f8d58e839e45a37a23f70092aa5c4662d Mon Sep 17 00:00:00 2001 From: Otho Date: Mon, 16 Jan 2023 21:28:42 -0500 Subject: [PATCH] Fixed order of operation. --- backup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 29ad391..c72e940 100755 --- a/backup.sh +++ b/backup.sh @@ -24,10 +24,6 @@ SSH_SEND_OPTS="-Ti ~/.ssh/id_rsa" DEF_SPEED="20M" read LOCAL_HOST LOCAL_USER LOCAL_PORT LOCAL_TZ SEND_COMPRESSED < $nodes_file -case $SEND_COMPRESSED in - [tTyY]*) ZFS_SEND_OPTS="$ZFS_SEND_OPTS -c" - debug "Enabled send as compressed datasets." ;; -esac ORIGIN_PERMS="send,snapshot,hold" MIRROR_PERMS="compression,receive,create,mount,mountpoint,readonly,jailed" @@ -42,6 +38,13 @@ debug() fi } +set_compression() { + case $SEND_COMPRESSED in + [tTyY]*) ZFS_SEND_OPTS="$ZFS_SEND_OPTS -c" + debug "Enabled send as compressed datasets." ;; + esac +} + populate_datasets() { while read dataset dataset_options; do @@ -272,6 +275,7 @@ done tail -n +2 $nodes_file|grep -v '^#' > sendnodes.tmp +set_compression populate_datasets ### Command