Skip to content

fix: count unreadable source files during backup - #561

Open
BradKollmyer wants to merge 1 commit into
rustic-rs:mainfrom
BradKollmyer:fix/backup-unreadable-source-errors
Open

fix: count unreadable source files during backup#561
BradKollmyer wants to merge 1 commit into
rustic-rs:mainfrom
BradKollmyer:fix/backup-unreadable-source-errors

Conversation

@BradKollmyer

Copy link
Copy Markdown

Summary

  • count source scan and archival errors instead of only logging them
  • report those errors through Progress::error (scan / archival)
  • attach the source path on local walk/open failures
  • expose a non-persisted SnapshotSummary.error_count for the just-completed backup

Why

restic returns exit code 3 when some source files cannot be read, and still creates a snapshot of the remaining files. rustic currently ignores those errors and exits 0, so automation cannot detect incomplete backups.

Validation

  • cargo test --test integration test_backup_unreadable_file_sets_error_count (unix; chmod 000 file)
  • cargo fmt --all
  • clippy on the changed files

A companion rustic CLI PR will use error_count to exit 3 and emit restic-compatible JSON error / exit_error messages.

Track scan and archival errors instead of silently ignoring them, and
expose the count on SnapshotSummary so callers can return restic exit
code 3 for incomplete snapshots.
@BradKollmyer

Copy link
Copy Markdown
Author

Companion CLI PR: rustic-rs/rustic#1908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant