Merge pull request #60 from nextcloud/enh/56/exclude-some-folders-from-restore

exclude the session and certs folder from restore
This commit is contained in:
Simon Lindner 2021-12-07 19:24:38 +01:00 committed by GitHub
commit 5901054b21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,7 +171,11 @@ if [ "$BORG_MODE" = restore ]; then
echo "Could not mount the backup!"
exit 1
fi
if ! rsync --stats --archive --human-readable -vv --delete --exclude "nextcloud_aio_mastercontainer/data/backup_archives.list" /tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then
if ! rsync --stats --archive --human-readable -vv --delete \
--exclude "nextcloud_aio_mastercontainer/data/backup_archives.list" \
--exclude "nextcloud_aio_mastercontainer/data/session/"** \
--exclude "nextcloud_aio_mastercontainer/data/certs/"** \
/tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then
echo "Something failed while restoring the boot partition."
umount /tmp/borg
exit 1