File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,34 @@ You can use hooks, e.g. to send a notification when a backup has finished:
90
90
run-after = [" notify-send 'Backup finished successfully!'" ]
91
91
```
92
92
93
+ ### Hook command failure
94
+
95
+ By default, if a hook command fails, ` rustic ` will log the error and stop. If
96
+ you would like ` rustic ` to continue its process with just a warning in the logs
97
+ or nothing, you can use the ` on_failure ` field.
98
+
99
+ The ` on_failure ` field takes ` "error" ` by default and can take ` "warn" ` and
100
+ ` "ignore" ` as well.
101
+
102
+ A first way to write it:
103
+
104
+ ``` toml
105
+ [backup .hooks ]
106
+ run-after = [
107
+ { command = " notify-send" , args = [" Backup finished successfully!" ], on_failure = " warn" },
108
+ ]
109
+ ```
110
+
111
+ An alternative way possible with the toml format:
112
+
113
+ ``` toml
114
+ [[backup .hooks .run-after ]]
115
+ command = " notify-send"
116
+ args = [" Backup finished successfully!" ]
117
+ # optional
118
+ on_failure = " warn" # possible values are "error" (default), "warn", "ignore"
119
+ ```
120
+
93
121
## Use cases
94
122
95
123
Here are some use cases which might be interesting to use hooks for:
You can’t perform that action at this time.
0 commit comments