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