From 88205e510e05c60b6fea766dc4f95afa34276d09 Mon Sep 17 00:00:00 2001 From: Matt Speer Date: Sat, 3 Oct 2026 15:07:13 -0500 Subject: [PATCH] fix(backup): dereference symlinks using rsync -L flag Add the -L (--copy-links) flag to rsync calls for systemd units and cron directories to dereference symlinks into actual target files, resolving "Operation not permitted" failures on non-POSIX target filesystems. --- host_backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host_backup.sh b/host_backup.sh index c5779ce..3990950 100644 --- a/host_backup.sh +++ b/host_backup.sh @@ -95,7 +95,7 @@ if [ -f "/etc/crontab" ]; then fi if [ -d "/etc/cron.d" ]; then - rsync -a /etc/cron.d "$CURRENT_BACKUP_DIR/cron/" + rsync -aL /etc/cron.d "$CURRENT_BACKUP_DIR/cron/" echo "Backed up: /etc/cron.d directory" fi @@ -103,7 +103,7 @@ fi # Task 4: Backup Custom Systemd Units & Services # ============================================================================== if [ -d "$SYSTEMD_SOURCE" ]; then - rsync -a "$SYSTEMD_SOURCE/" "$CURRENT_BACKUP_DIR/systemd/" + rsync -aL "$SYSTEMD_SOURCE/" "$CURRENT_BACKUP_DIR/systemd/" echo "Backed up: $SYSTEMD_SOURCE" else echo "Warning: Systemd directory '$SYSTEMD_SOURCE' not found." >&2