Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match restic exit codes #1346

Open
judahrand opened this issue Nov 6, 2024 · 3 comments
Open

match restic exit codes #1346

judahrand opened this issue Nov 6, 2024 · 3 comments
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` A-errors Area: error handling needs improvement C-enhancement Category: New feature or request

Comments

@judahrand
Copy link

judahrand commented Nov 6, 2024

restic has some well defined exit code which help when using it in scripts. These exit codes are defined in the documentation. It would be fantastic if rustic could maintain compatibility with these exit codes as it would make migration to rustic much easier. There are clearly some exit codes, for example code 11 which relates to locking which rustic would never use but the others are relevant.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Nov 6, 2024
@simonsan simonsan added C-enhancement Category: New feature or request A-errors Area: error handling needs improvement A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Nov 6, 2024
@simonsan simonsan changed the title [Feature Request] match restic exit codes match restic exit codes Nov 6, 2024
@nardoor
Copy link
Contributor

nardoor commented Nov 17, 2024

This is something I wouldn't mind doing at all.

For context, rustic_core error management was totally refactored recently.
Once it is stable we can probably start there.

@simonsan
Copy link
Contributor

simonsan commented Nov 19, 2024

Current state of affairs:

✅ = implemented, ⚠️ = inconsistent, ❌ = not implemented, yet

Code Description status in rustic
0 Command was successful
1 Command failed, see command help for more details ⚠️
2 Go runtime error (not applicable)
3 backup command could not read some source data
10 Repository does not exist (since restic 0.17.0)
11 Failed to lock repository (since restic 0.17.0) (not applicable)
12 Wrong password (since restic 0.17.1)
130 Restic was interrupted using SIGINT or SIGSTOP

@aawsome
Copy link
Member

aawsome commented Nov 19, 2024

For exit codes > 128, se should follow the standard exit codes, see https://tldp.org/LDP/abs/html/exitcodes.html.
And this already works - interrupting rustic by SIGINT gives error code 130, SIGSTOP gives 147.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` A-errors Area: error handling needs improvement C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants