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.
This commit is contained in:
mattspeer committed 2026-10-03 15:07:13 -05:00
1 parent 232390b0ff
commit 88205e510e
1 file changed
+2 -2
+2 -2
View File
@@ -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