diff --git a/infrastrucure/docker/image/resources/backup.sh b/infrastrucure/docker/image/resources/backup.sh index 719a464..9f5d1b2 100644 --- a/infrastrucure/docker/image/resources/backup.sh +++ b/infrastrucure/docker/image/resources/backup.sh @@ -1,8 +1,6 @@ -su -s /bin/bash -c 'php occ maintenance:mode --on' www-data set -o pipefail # backup database dump pg_dump -d $(cat ${POSTGRES_DB_FILE}) -h $POSTGRES_SERVICE -p $POSTGRES_PORT -U $(cat ${POSTGRES_USER_FILE}) --no-password --serializable-deferrable --clean --no-privileges | \ restic -r $RESTIC_REPOSITORY --verbose backup --stdin --tag DB_Backup # backup nextcloud filesystem restic -r $RESTIC_REPOSITORY backup /var/backups/ --tag Nextcloud_Filesystem -su -s /bin/bash -c 'php occ maintenance:mode --off' www-data diff --git a/infrastrucure/docker/image/resources/restore.sh b/infrastrucure/docker/image/resources/restore.sh index 63a1f80..90972c9 100644 --- a/infrastrucure/docker/image/resources/restore.sh +++ b/infrastrucure/docker/image/resources/restore.sh @@ -1,6 +1,5 @@ # Restore Nextcloud Filesystem -# turn on maintenance mode -su -s /bin/bash -c 'php occ maintenance:mode --on' www-data + # Reads restore snapshot_ID from first CLI Argument restic -r $RESTIC_REPOSITORY restore $1 --target / @@ -12,5 +11,3 @@ psql -d template1 -h $POSTGRES_SERVICE -p $POSTGRES_PORT -U $(cat ${POSTGRES_USE restic -r $RESTIC_REPOSITORY restore $2 --target test-stdin-$2 # read folder and restore db entries psql -d $(cat ${POSTGRES_DB_FILE}) -h $POSTGRES_SERVICE -p $POSTGRES_PORT -U $(cat ${POSTGRES_USER_FILE}) --no-password < test-stdin-$2 -# turn off maintenance mode -su -s /bin/bash -c 'php occ maintenance:mode --off' www-data