Don't rsync empty directories, but do show in debug

This commit is contained in:
Eric Renfro 2024-07-02 16:18:29 -04:00
parent a7eb0e5658
commit 8b43529790
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

View file

@ -62,7 +62,9 @@ function create_subvolumes() {
for subvol in "${subvols[@]}" for subvol in "${subvols[@]}"
do do
${cmd} btrfs subvolume create /mnt/"$subvol" ${cmd} btrfs subvolume create /mnt/"$subvol"
if [[ -d "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}" || "DEBUG" ]]; then
${cmd} rsync -avhHi --delete-after "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}/" "/mnt/$subvol/" ${cmd} rsync -avhHi --delete-after "/mnt/@/${SUBVOLS_DEFAULT[$subvol]}/" "/mnt/$subvol/"
fi
done done
${cmd} umount /mnt ${cmd} umount /mnt