This commit is contained in:
oliver
2026-04-21 16:04:12 -03:00
parent 04f665a20d
commit 3c33bd86e5
2 changed files with 10 additions and 5 deletions
+10 -5
View File
@@ -10,13 +10,18 @@ HOSTNAME=$(hostname)
DATE=$(date +%Y-%m-%d_%H-%M-%S)
ARCHIVE_NAME="${HOSTNAME}-${DATE}"
shopt -s globstar
borg create \
# Resolve symlinks externally and feed real paths to borg via --paths-from-stdin.
# - First find: locates all current* symlinks under /BACKUP and resolves them with realpath.
# - Second find: locates all regular current* files under /BACKUP (non-symlinks).
# - sort -u: deduplicates in case a resolved symlink target overlaps with a regular file.
{
find /BACKUP -name 'current*' -type l -print0 | xargs -0 -I {} realpath {}
find /BACKUP -name 'current*' ! -type l
} | sort -u | borg create \
--verbose \
--stats \
--compression lz4 \
--follow-symlinks \
::$ARCHIVE_NAME \
/BACKUP/**/current*
--paths-from-stdin \
::$ARCHIVE_NAME
echo "Backup completed: $ARCHIVE_NAME"