From 8b4352979016ea91e530917ec60d51f5e44a11a8 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Tue, 2 Jul 2024 16:18:29 -0400 Subject: [PATCH] Don't rsync empty directories, but do show in debug --- linuxmint-postsetup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linuxmint-postsetup.sh b/linuxmint-postsetup.sh index 9bf60e3..6b180b2 100755 --- a/linuxmint-postsetup.sh +++ b/linuxmint-postsetup.sh @@ -62,7 +62,9 @@ function create_subvolumes() { for subvol in "${subvols[@]}" do ${cmd} btrfs subvolume create /mnt/"$subvol" - ${cmd} rsync -avhHi --delete-after "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}/" "/mnt/$subvol/" + if [[ -d "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}" || "DEBUG" ]]; then + ${cmd} rsync -avhHi --delete-after "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}/" "/mnt/$subvol/" + fi done ${cmd} umount /mnt