From 2a01e9683b86e85e6969b9e17f78707fee2c5c5f Mon Sep 17 00:00:00 2001 From: Simon L Date: Thu, 2 Mar 2023 16:39:18 +0100 Subject: [PATCH] exclude nextcloud and audit log in backup due to GPDR reasons Signed-off-by: Simon L --- Containers/borgbackup/backupscript.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Containers/borgbackup/backupscript.sh b/Containers/borgbackup/backupscript.sh index d4ef0e71..15d030c0 100644 --- a/Containers/borgbackup/backupscript.sh +++ b/Containers/borgbackup/backupscript.sh @@ -129,10 +129,13 @@ if [ "$BORG_MODE" = backup ]; then # https://forum.level1techs.com/t/optimal-compression-for-borg-backups/145870/6 BORG_OPTS=(-v --stats --compression "auto,zstd" --exclude-caches --checkpoint-interval 86400) + # Exclude the nextcloud log and audit log for GDPR reasons + BORG_EXCLUDE=(--exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log"* --exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log") + # Create the backup echo "Starting the backup..." get_start_time - if ! borg create "${BORG_OPTS[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/"; then + if ! borg create "${BORG_OPTS[@]}" "${BORG_EXCLUDE[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/"; then echo "Deleting the failed backup archive..." borg delete --stats "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio" echo "Backup failed!" @@ -266,6 +269,8 @@ if [ "$BORG_MODE" = restore ]; then if ! rsync --stats --archive --human-readable -vv --delete \ --exclude "nextcloud_aio_apache/caddy/"** \ --exclude "nextcloud_aio_mastercontainer/caddy/"** \ + --exclude "nextcloud_aio_nextcloud/data/nextcloud.log"* \ + --exclude "nextcloud_aio_nextcloud/data/audit.log" \ --exclude "nextcloud_aio_mastercontainer/certs/"** \ --exclude "nextcloud_aio_mastercontainer/data/configuration.json" \ --exclude "nextcloud_aio_mastercontainer/data/daily_backup_running" \