Treat rsync exit codes 23/24 as warnings, not failures
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 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,14 @@ rsync_to_remote() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
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"
|
log_warn "rsync failed (exit $rc), attempt $attempt/$max_retries"
|
||||||
|
|
||||||
if (( attempt < max_retries )); then
|
if (( attempt < max_retries )); then
|
||||||
@@ -116,6 +124,11 @@ rsync_local() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
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"
|
log_warn "rsync (local) failed (exit $rc), attempt $attempt/$max_retries"
|
||||||
|
|
||||||
if (( attempt < max_retries )); then
|
if (( attempt < max_retries )); then
|
||||||
|
|||||||
Reference in New Issue
Block a user