You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Using resticprofile and systemd](#using-resticprofile-and-systemd)
@@ -1004,6 +1005,40 @@ This order is important:
1004
1005
- now you can change your permission (`user` to `system`, or `system` to `user`)
1005
1006
- `schedule` your updated profile
1006
1007
1008
+
## Status file for easy monitoring
1009
+
1010
+
If you need to escalate the result of your backup to a monitoring system, you can definitely use the `run-after` and `run-after-fail` scripting.
1011
+
1012
+
But sometimes we just need something simple that a monitoring system can regularly check. For that matter, resticprofile can generate a simple JSON file with the details of the latest backup/forget/check command. I have a Zabbix agent checking this file once a day, and you can hook up any monitoring system that can load a JSON file.
1013
+
1014
+
In your profile, you simply need to add a new parameter, which is the location of your status file
1015
+
1016
+
```toml
1017
+
[my-backup]
1018
+
status-file = "backup-status.json"
1019
+
```
1020
+
1021
+
Here's an example of a generated file, where you can see that the last check failed, whereas the last backup succeeded:
1022
+
1023
+
```json
1024
+
{
1025
+
"profiles": {
1026
+
"my-backup": {
1027
+
"backup": {
1028
+
"success": true,
1029
+
"time": "2020-07-31T23:54:00.401556+01:00",
1030
+
"error": ""
1031
+
},
1032
+
"check": {
1033
+
"success": false,
1034
+
"time": "2020-07-31T23:47:22.311848+01:00",
1035
+
"error": "exit status 1"
1036
+
}
1037
+
}
1038
+
}
1039
+
}
1040
+
```
1041
+
1007
1042
## Configuration file reference
1008
1043
1009
1044
`[global]`
@@ -1034,6 +1069,7 @@ Flags used by resticprofile only
0 commit comments