From 0a7c2676e8449db4a7e5a175cae797b613a05450 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Fri, 10 Dec 2021 10:21:36 +0100 Subject: [PATCH] remove skipped db backup --- infrastructure/docker-backup/image/resources/backup.sh | 10 ++++------ .../docker-backup/image/resources/restore.sh | 10 ++++------ .../docker-backup/image/resources/start-maintenance.sh | 3 +++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/infrastructure/docker-backup/image/resources/backup.sh b/infrastructure/docker-backup/image/resources/backup.sh index 99e1e05..72b5414 100755 --- a/infrastructure/docker-backup/image/resources/backup.sh +++ b/infrastructure/docker-backup/image/resources/backup.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -o pipefail +set -xo pipefail function main() { @@ -13,12 +13,10 @@ function main() { file_env POSTGRES_USER file_env RESTIC_DAYS_TO_KEEP 14 -echo re-add lines !!! - #disable for faster testing - #backup-roles 'oc_' - #backup-db-dump + backup-roles 'oc_' + backup-db-dump ls -l /var/backups/ -# backup-directory '/var/backups/' + backup-directory '/var/backups/' end-maintenance.sh } diff --git a/infrastructure/docker-backup/image/resources/restore.sh b/infrastructure/docker-backup/image/resources/restore.sh index 61d1d07..49e3378 100755 --- a/infrastructure/docker-backup/image/resources/restore.sh +++ b/infrastructure/docker-backup/image/resources/restore.sh @@ -13,13 +13,11 @@ function main() { file_env POSTGRES_PASSWORD file_env POSTGRES_USER -echo re-add lines !!! -# drop-create-db + drop-create-db - #skip for fast testing - #restore-roles - #restore-db -# restore-directory '/var/backups/' + restore-roles + restore-db + restore-directory '/var/backups/' } diff --git a/infrastructure/docker-backup/image/resources/start-maintenance.sh b/infrastructure/docker-backup/image/resources/start-maintenance.sh index 0915a37..e3bbace 100644 --- a/infrastructure/docker-backup/image/resources/start-maintenance.sh +++ b/infrastructure/docker-backup/image/resources/start-maintenance.sh @@ -6,7 +6,10 @@ if [ ! -f "/var/backups/config/config.orig" ]; then rm -f /var/backups/config/config.orig cp /var/backups/config/config.php /var/backups/config/config.orig + + # put nextcloud in maintenance mode sed -i "s/);/ \'maintenance\' => true,\n);/g" /var/backups/config/config.php + chown www-data:root /var/backups/config/config.php touch /var/backups/config/config.php