From 69f388de1129a969fac2f1fe030654fe803c7d23 Mon Sep 17 00:00:00 2001 From: Michael Albert Date: Wed, 12 Jul 2017 10:47:20 -0400 Subject: [PATCH 1/2] Currently, since there are no UUIDs listed when TARGETS is computed, then nothing is excluded even if a number of the mounts shouldn't be there. This fixes that and ensures that the UUIDs are correctl listed with the right mount point. This was originall broken in commit c4f12235ae1c06cf4a9ab08e1dbded96e4b49129. --- bin/snap-sync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/snap-sync b/bin/snap-sync index 686fcb7..0c6187f 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -161,8 +161,8 @@ fi if [[ "$(findmnt -n -v --target / -o FSTYPE)" == "btrfs" ]]; then EXCLUDE_UUID=$(findmnt -n -v -t btrfs --target / -o UUID) - TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list | grep -v $EXCLUDE_UUID) - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list | grep -v $EXCLUDE_UUID) + TARGETS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v $EXCLUDE_UUID | awk '{print $2}') + UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARKET --list | grep -v $EXCLUDE_UUID | awk '{print $1}') else TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list) UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list) From 1a217f416be2a169b7516c9e3aaf032ea5e1ccbd Mon Sep 17 00:00:00 2001 From: Michael Albert Date: Wed, 12 Jul 2017 10:52:15 -0400 Subject: [PATCH 2/2] Fixed typo from TARKET to TARGET. --- bin/snap-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/snap-sync b/bin/snap-sync index 0c6187f..b2d2d10 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -162,7 +162,7 @@ fi if [[ "$(findmnt -n -v --target / -o FSTYPE)" == "btrfs" ]]; then EXCLUDE_UUID=$(findmnt -n -v -t btrfs --target / -o UUID) TARGETS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v $EXCLUDE_UUID | awk '{print $2}') - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARKET --list | grep -v $EXCLUDE_UUID | awk '{print $1}') + UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v $EXCLUDE_UUID | awk '{print $1}') else TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list) UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list)