From 18af43936c033407fe12ff5ce04a2e239ae6b875 Mon Sep 17 00:00:00 2001 From: shuki Date: Fri, 6 Mar 2026 16:51:13 +0200 Subject: [PATCH] Treat rsync exit codes 23/24 as warnings, not failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exit 23 (partial transfer, permission denied) and 24 (vanished files) are expected in non-root backups. These no longer trigger retries or fail the backup — they log a warning and continue. Co-Authored-By: Claude Opus 4.6 --- lib/transfer.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/transfer.sh b/lib/transfer.sh index 09ad4f7..be63739 100644 --- a/lib/transfer.sh +++ b/lib/transfer.sh @@ -57,6 +57,14 @@ rsync_to_remote() { return 0 fi + # Exit 23 = partial transfer (permission denied on some files) + # Exit 24 = vanished source files (deleted during transfer) + # Both are expected in non-root backups — treat as success with warning + if (( rc == 23 || rc == 24 )); then + log_warn "rsync completed with warnings (exit $rc): some files could not be transferred" + return 0 + fi + log_warn "rsync failed (exit $rc), attempt $attempt/$max_retries" if (( attempt < max_retries )); then @@ -116,6 +124,11 @@ rsync_local() { return 0 fi + if (( rc == 23 || rc == 24 )); then + log_warn "rsync (local) completed with warnings (exit $rc): some files could not be transferred" + return 0 + fi + log_warn "rsync (local) failed (exit $rc), attempt $attempt/$max_retries" if (( attempt < max_retries )); then