diff --git a/doc/075_scripting.rst b/doc/075_scripting.rst index e11f280db..ae876c9ea 100644 --- a/doc/075_scripting.rst +++ b/doc/075_scripting.rst @@ -38,6 +38,33 @@ to ``cat config``) and it may print a different error message. If there are no errors, restic will return a zero exit code and print the repository metadata. +Exit codes +********** + +Restic commands return an exit code that signals whether the command was successful. +The following table provides a general description, see the help of each command for +a more specific description. + +.. warning:: + New exit codes will be added over time. If an unknown exit code is returned, then it + MUST be treated as a command failure. + ++-----+----------------------------------------------------+ +| 0 | Command was successful | ++-----+----------------------------------------------------+ +| 1 | Command failed, see command help for more details | ++-----+----------------------------------------------------+ +| 2 | Go runtime error | ++-----+----------------------------------------------------+ +| 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) | ++-----+----------------------------------------------------+ +| 130 | Restic was interrupted using SIGINT or SIGSTOP | ++-----+----------------------------------------------------+ + JSON output ***********