Merge pull request #1982 from nextcloud/enh/noid/improve-restore

also restore configuration.json even if the former restore failed
This commit is contained in:
Simon L 2023-02-16 17:25:09 +01:00 committed by GitHub
commit 244424efee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -272,9 +272,8 @@ if [ "$BORG_MODE" = restore ]; then
--exclude "nextcloud_aio_mastercontainer/data/session_date_file" \
--exclude "nextcloud_aio_mastercontainer/session/"** \
/tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then
RESTORE_FAILED=1
echo "Something failed while restoring from backup."
umount /tmp/borg
exit 1
fi
# Save current aio password
@ -294,9 +293,8 @@ if [ "$BORG_MODE" = restore ]; then
if ! rsync --archive --human-readable -vv \
/tmp/borg/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json \
/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json; then
RESTORE_FAILED=1
echo "Something failed while restoring the configuration.json."
umount /tmp/borg
exit 1
fi
# Set backup-mode to restore since it was a restore
@ -331,6 +329,10 @@ if [ "$BORG_MODE" = restore ]; then
umount /tmp/borg
if [ "$RESTORE_FAILED" = 1 ]; then
exit 1
fi
# Inform user
get_expiration_time
echo "Restore finished successfully on $END_DATE_READABLE ($DURATION_READABLE)"