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