Re: Error exits on busy systems
John Goerzen <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.dar.support |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Jul 10 2021, Denis Corbin wrote: >> Fundamentally, I think it is good practice to always write >> shell scripts >> with "set -eou pipefail" on (that is, abort with any nonzero >> exit code) > > applications. For that reason, having more than two exit codes > is much > more robust than parsing, while using exit code with boolean > approach > leads to very fragile scripts (they fail anytime you are not in > the > perfect condition). You make a very good point here. We don't have a great way to indicate various kinds of status other than exit codes. So that brings up the question: what exit codes should be taken as success in my particular case? I know already 0 and 11. I'm unsure about 5; I've definitely seen it in cases where I'd consider the backup to be a success, but the manpage also says "this is the case when a file could not be opened or read", implying possible I/O error or something. Am I misreading that? Thanks, John