removed maintenance mode from backup and restore

This commit is contained in:
mattisderbock@gmail.com 2020-11-27 09:16:25 +01:00
parent 34895b7372
commit 82751c0b54
2 changed files with 1 additions and 6 deletions

View file

@ -1,8 +1,6 @@
su -s /bin/bash -c 'php occ maintenance:mode --on' www-data
set -o pipefail set -o pipefail
# backup database dump # 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 | \ 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 restic -r $RESTIC_REPOSITORY --verbose backup --stdin --tag DB_Backup
# backup nextcloud filesystem # backup nextcloud filesystem
restic -r $RESTIC_REPOSITORY backup /var/backups/ --tag Nextcloud_Filesystem restic -r $RESTIC_REPOSITORY backup /var/backups/ --tag Nextcloud_Filesystem
su -s /bin/bash -c 'php occ maintenance:mode --off' www-data

View file

@ -1,6 +1,5 @@
# Restore Nextcloud Filesystem # 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 # Reads restore snapshot_ID from first CLI Argument
restic -r $RESTIC_REPOSITORY restore $1 --target / 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 restic -r $RESTIC_REPOSITORY restore $2 --target test-stdin-$2
# read folder and restore db entries # 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 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