From 918afa1a94b32ce298f37252da626f01a4918f15 Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 30 Oct 2023 10:57:59 +0100 Subject: [PATCH] allow to back up empty additional volumes Signed-off-by: Simon L --- Containers/borgbackup/backupscript.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Containers/borgbackup/backupscript.sh b/Containers/borgbackup/backupscript.sh index d10486bf933..41394ad69dd 100644 --- a/Containers/borgbackup/backupscript.sh +++ b/Containers/borgbackup/backupscript.sh @@ -72,10 +72,10 @@ if [ "$BORG_MODE" = backup ]; then exit 1 fi - # Test that nothing is empty - for directory in "${VOLUME_DIRS[@]}"; do - if [ -z "$(ls -A "$directory")" ] && [ "$directory" != "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch" ]; then - echo "$directory is empty which is not allowed." + # Test that default volumes are not empty + for volume in "${DEFAULT_VOLUMES[@]}"; do + if [ -z "$(ls -A "/nextcloud_aio_volumes/$volume")" ] && [ "$volume" != "nextcloud_aio_elasticsearch" ]; then + echo "/nextcloud_aio_volumes/$volume is empty which should not happen!" exit 1 fi done