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:
1 parent
232390b0ff
commit
88205e510e
1 file changed
+2
-2
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user