-
Notifications
You must be signed in to change notification settings - Fork 70
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
Rustic returns exit code 0 when errors occur #927
Comments
@florensie Thanks for opening the issue - in fact rustic doesn't return exit codes if something fails. This should be enhanced. About the exit code when the repository is not initialized: What is your specific use case? If it is to check whether a repository should be initialized before backing up, try |
For my case I need to check the existing snapshots before I do any backups, so unfortunately |
Sorry for the late follow-up! Out of curiosity: Can you describe your use case in more detail? What do you want to do and where do you need the information if the repository is initialized? |
I just recalled that non-0 exit codes should be already implemented; at least I thought that if let Err(err) = self.inner_run() {
status_err!("{}", err);
RUSTIC_APP.shutdown(Shutdown::Crash);
}; should do exactly this. But it seems it doesn't.... |
/// Shut down this application gracefully, exiting with success.
fn shutdown(&self, shutdown: Shutdown) -> ! {
let components = self.state().components();
if let Err(e) = components.shutdown(self, shutdown) {
fatal_error(self, &e)
}
process::exit(0);
} Shutdown always returns Ref.: iqlusioninc/abscissa#857 |
The corresponding PR with delivering an extra method for this has been merged and a new abscissa release will be made soon™️. |
Is it possible to pin the latest master of |
@Schweber This is possible - but when uploading a version to crates.io, git dependencies are not allowed, only dependencies to projects/versions also released to crates.io... |
rustic now returns an error code for failing command. Note: Some command do not fail yet fail in every cases user would expect is. Most notably the `check` ckommand producing `error` messages may still return error code 0. closes #927
For automation tools it would be useful if a non-zero exit code is returned when the repository is not initialized. In fact this is exactly what Restic suggests you do in their scripting documentation, but it doesn't work for Rustic:
There may be more instances where exit codes are not properly implemented, but this is all I have tested as of now.
The text was updated successfully, but these errors were encountered: