fix(backup): exclude snap unit files from systemd rsync
Excludes snap-generated mount files (`*snap*.mount`) and `snapd.mounts.target.wants` from the `/etc/systemd/system` rsync backup task. Prevents 'Invalid argument (22)' errors caused by escaped backslashes (`\x2d`) in dynamic snap mount file names when syncing to non-POSIX destination filesystems.
This commit is contained in:
1 parent
88205e510e
commit
0e0d28b531
1 file changed
+4
-1
+4
-1
@@ -103,7 +103,10 @@ fi
|
||||
# Task 4: Backup Custom Systemd Units & Services
|
||||
# ==============================================================================
|
||||
if [ -d "$SYSTEMD_SOURCE" ]; then
|
||||
rsync -aL "$SYSTEMD_SOURCE/" "$CURRENT_BACKUP_DIR/systemd/"
|
||||
rsync -aL \
|
||||
--exclude='*snap*.mount' \
|
||||
--exclude='snapd.mounts.target.wants' \
|
||||
"$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