From c6ac73bc83a2cd908786cf5e35069b414192b6c7 Mon Sep 17 00:00:00 2001 From: "Oliver Surke (Gitea)" Date: Tue, 12 May 2026 10:43:13 +0200 Subject: [PATCH] fix: remove Unix socket files before mackup backup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mackup fails with shutil.Error [Errno 102] when it tries to copy Unix socket files (e.g. iTerm2's iterm2-daemon-1.socket, sockets/secrets). Sockets are ephemeral runtime artefacts — they cannot be meaningfully backed up and are always recreated by the owning app on startup. Purge all -type s files from $HOME before calling mackup backup. Co-authored-by: Cursor --- lib/mackup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/mackup.sh b/lib/mackup.sh index 705ac8a..853c36b 100644 --- a/lib/mackup.sh +++ b/lib/mackup.sh @@ -182,6 +182,16 @@ ssr::mackup::backup() { fi [[ -n "$mackup_root" ]] && ssr::mackup::_materialize_icloud "$mackup_root" + # Unix socket files (type s) cannot be copied and are always recreated + # by their owning app on startup. Remove them from $HOME before backup + # to prevent shutil.Error: [Errno 102] Operation not supported on socket. + local socket_count + socket_count="$(find "$HOME" -type s 2>/dev/null | wc -l | tr -d ' ')" + if [[ "$socket_count" -gt 0 ]]; then + ssr::log "Removing $socket_count Unix socket file(s) before mackup backup (runtime artefacts)" + find "$HOME" -type s -delete 2>/dev/null || true + fi + local attempt rc=0 for attempt in 1 2 3; do if mackup -f backup; then