backup: return exit code 3 if not all targets are available#5347
Merged
MichaelEischer merged 6 commits intoOct 5, 2025
Merged
Conversation
40cadc1 to
d31d6ba
Compare
03d4992 to
6f5d1e6
Compare
cabe397 to
06ce995
Compare
06ce995 to
72e2aa7
Compare
Contributor
Author
|
Hi @MichaelEischer, bubbling this PR up since I see you are reviewing some PRs. |
72e2aa7 to
2342a1c
Compare
2342a1c to
6a3ab69
Compare
MichaelEischer
requested changes
Oct 4, 2025
MichaelEischer
left a comment
Member
There was a problem hiding this comment.
Thanks, see below for comments and sorry for yet another merge conflict 🙈 .
* to make the exit code behaviour consistent with files inaccessible during the backup phase, making this change to exit with code 3 if not all target files/folders are accessible for backup resticgh-4467 backup: add changelog entry for resticgh-4467 bugfix: backup fails completely when one target is inaccessible chore: remove unnecessary err=nil tests: fix integration tests for non-existing file tests: update cmd_backup_test.go tests: fix backup tests and merge conflicts
6a3ab69 to
805dcb3
Compare
MichaelEischer
requested changes
Oct 5, 2025
MichaelEischer
left a comment
Member
There was a problem hiding this comment.
The PR in its current form is completely broken, see comments and suggestions below.
Co-authored-by: Michael Eischer <michael.eischer@gmx.de>
Co-authored-by: Michael Eischer <michael.eischer@gmx.de>
Co-authored-by: Michael Eischer <michael.eischer@gmx.de>
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.
What does this PR change? What problem does it solve?
Restic
backupcommand will also exit with code 3 if any one of the targets selected for backup are inaccessible. Previously, thebackupcommand would exit with code 3 only if a child directory or file was inaccessible.I have modified the
collectTargetsfunction in thecmd_backup.gocommand to check if all the targets collected from command line args,--files-from,--files-from-verbatimand--files-from-raware accessible. If any of the targets are inaccessible then, we return theErrInvalidSourceDatatowards the end; this will result in a exit code3(partial snapshot)Was the change previously discussed in an issue or on the forum?
Closes #4467
Checklist
changelog/unreleased/that describes the changes for our users (see template).