Skip to content

Commit

Permalink
Add comment to keep exclude patterns in sync
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Diels <[email protected]>
  • Loading branch information
timdiels committed Oct 27, 2024
1 parent 6dd8653 commit 5078c4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Containers/borgbackup/backupscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ if [ "$BORG_MODE" = restore ]; then
fi

# Restore everything except the configuration file
#
# These exclude patterns need to be kept in sync with the borg_excludes file and the find excludes in this file,
# which use a different syntax (patterns appear in 3 places in total)
if ! rsync --stats --archive --human-readable -vv --delete \
--exclude "nextcloud_aio_apache/caddy/**" \
--exclude "nextcloud_aio_mastercontainer/caddy/**" \
Expand Down Expand Up @@ -395,6 +398,8 @@ if [ "$BORG_MODE" = restore ]; then
# https://unix.stackexchange.com/a/759341
# This comm does not support -z, but I doubt any file names would have \n in them
echo "Deleting local files which do not exist in the backup"
# These find patterns need to be kept in sync with the borg_excludes file and the rsync excludes in this
# file, which use a different syntax (patterns appear in 3 places in total)
if ! find nextcloud_aio_volumes \
-not \( \
-path nextcloud_aio_volumes/nextcloud_aio_apache/caddy \
Expand Down
2 changes: 2 additions & 0 deletions Containers/borgbackup/borg_excludes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# These patterns need to be kept in sync with rsync and find excludes in backupscript.sh,
# which use a different syntax (patterns appear in 3 places in total)
nextcloud_aio_volumes/nextcloud_aio_apache/caddy/
nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy/
nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*
Expand Down

0 comments on commit 5078c4f

Please sign in to comment.