fix: return exit code 3 when backup source files are unreadable - #1908
Open
BradKollmyer wants to merge 2 commits into
Open
fix: return exit code 3 when backup source files are unreadable#1908BradKollmyer wants to merge 2 commits into
BradKollmyer wants to merge 2 commits into
Conversation
Match restic: still save the snapshot, warn, and exit 3. With JSON output, emit per-file error messages and a final exit_error with code 3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Warning: at least one source file could not be read--json/--json-progress, emit restic-compatible JSONerrorlines and a finalexit_errorwithcode: 3error_counton JSON status messages--helpDepends on rustic-rs/rustic_core#561 (
SnapshotSummary.error_countandProgress::error). CI will not compile against crates.iorustic_core0.13.0 until that lands and is released.Why
restic reports exit code 3 (and JSON
exit_error) when source data is unreadable, while still creating a snapshot of the remaining files. rustic currently exits 0 in that case, so scripts cannot detect incomplete backups.Validation
cargo test --test backup_restore test_backup_unreadable_file --offline(unix)backup_restoretests still passcargo fmt/ clippy on the changed files