From d1d3edf274b9cf279391250d5cd0a0f066620c2d Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 12 Jul 2020 20:33:43 +0200 Subject: Repaired encryption support --- systemd-zfs-partition-backup.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/systemd-zfs-partition-backup.sh b/systemd-zfs-partition-backup.sh index 8a89718..f012451 100755 --- a/systemd-zfs-partition-backup.sh +++ b/systemd-zfs-partition-backup.sh @@ -6,6 +6,7 @@ test -f /etc/default/systemd-zfs-partition-backup &&\ source /etc/default/systemd-zfs-partition-backup DISK_NAME=$1 +logger -p debug "disk: $DISK_NAME" function beep() { test -f /usr/bin/beep &&\ @@ -21,16 +22,17 @@ function fail() { function start() { UNIT_NAME=$(systemd-escape --suffix=automount $1) - systemctl start "$UNIT_NAME" || (fail "$UNIT_NAME not found." ; exit 1) + systemctl start "$UNIT_NAME" || (logger -p info "$UNIT_NAME not found." ; exit 1) } function stop() { UNIT_NAME=$(systemd-escape --suffix=automount $1) - systemctl stop "$UNIT_NAME" || (fail "$UNIT_NAME not found." ; exit 1) + systemctl stop "$UNIT_NAME" || (logger -p info "$UNIT_NAME not found." ; exit 1) } -logger -p debug "disk: $DISK_NAME [esc]=> $DISK_NAME_ESCAPED" +# we assume, that we can mount the device somewhere under media +start "media/$DISK_NAME" # without leading slash for the unit file DATASETS_WITH_DISKNAME=($(zfs list -H -o name | grep $DISK_NAME)) @@ -52,7 +54,6 @@ do DISK_MOUNTPOINT="/media/$DISK_NAME" - start "media/$DISK_NAME" # without leading slash for the unit file if ! findmnt $DISK_MOUNTPOINT; then logger -p debug "Expected to find disk '$DISK_NAME' mounted under '$DISK_MOUNTPOINT'. But it is not there. Aborting backup." @@ -94,7 +95,6 @@ do fi fi - stop "media/$DISK_NAME" # without leading slash for the unit file beep -f 831 -l 120 -n -f 294 -l 200 -n -f 147 else @@ -102,3 +102,4 @@ do fi done +stop "media/$DISK_NAME" # without leading slash for the unit file -- cgit v1.2.3