From 85999c297cd34a31b17617c3d3f2acf0f6f3f0b6 Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 12 Dec 2022 18:16:24 +0100 Subject: [PATCH 1/2] also back up the fulltextsearch volume Signed-off-by: Simon L --- Containers/borgbackup/backupscript.sh | 2 +- php/containers.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Containers/borgbackup/backupscript.sh b/Containers/borgbackup/backupscript.sh index d90f02a5..8d23eca9 100644 --- a/Containers/borgbackup/backupscript.sh +++ b/Containers/borgbackup/backupscript.sh @@ -66,7 +66,7 @@ if [ "$BORG_MODE" = backup ]; then # Test that nothing is empty for directory in "${VOLUME_DIRS[@]}"; do - if [ -z "$(ls -A "$directory")" ]; then + if [ -z "$(ls -A "$directory")" ] && [ "$directory" != "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch" ]; then echo "$directory is empty which is not allowed." exit 1 fi diff --git a/php/containers.json b/php/containers.json index 9412ed63..b603fe09 100644 --- a/php/containers.json +++ b/php/containers.json @@ -290,6 +290,11 @@ "name": "%BORGBACKUP_HOST_LOCATION%", "location": "/mnt/borgbackup", "writeable": true + }, + { + "name": "nextcloud_aio_elasticsearch", + "location": "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch", + "writeable": true } ], "secrets": [ From c6e45ef3789b64a460549a49dc31f5b46495b9ea Mon Sep 17 00:00:00 2001 From: Simon L Date: Tue, 13 Dec 2022 15:06:47 +0100 Subject: [PATCH 2/2] add exception for elasticsearch and re-order the exceptions Signed-off-by: Simon L --- Containers/borgbackup/backupscript.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Containers/borgbackup/backupscript.sh b/Containers/borgbackup/backupscript.sh index 8d23eca9..bacfa1b5 100644 --- a/Containers/borgbackup/backupscript.sh +++ b/Containers/borgbackup/backupscript.sh @@ -258,13 +258,14 @@ if [ "$BORG_MODE" = restore ]; then # Restore everything except the configuration file if ! rsync --stats --archive --human-readable -vv --delete \ - --exclude "nextcloud_aio_mastercontainer/session/"** \ + --exclude "nextcloud_aio_apache/caddy/"** \ + --exclude "nextcloud_aio_elasticsearch" \ + --exclude "nextcloud_aio_mastercontainer/caddy/"** \ --exclude "nextcloud_aio_mastercontainer/certs/"** \ + --exclude "nextcloud_aio_mastercontainer/data/configuration.json" \ --exclude "nextcloud_aio_mastercontainer/data/daily_backup_running" \ --exclude "nextcloud_aio_mastercontainer/data/session_date_file" \ - --exclude "nextcloud_aio_mastercontainer/data/configuration.json" \ - --exclude "nextcloud_aio_apache/caddy/"** \ - --exclude "nextcloud_aio_mastercontainer/caddy/"** \ + --exclude "nextcloud_aio_mastercontainer/session/"** \ /tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then echo "Something failed while restoring from backup." umount /tmp/borg