feat(restic): add scripts for directory backup and snapshot metrics generation
This commit is contained in:
12
roles/restic/files/restic-generate-snapshot-metrics.sh
Normal file
12
roles/restic/files/restic-generate-snapshot-metrics.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RESTIC_JSON=$(</dev/stdin)
|
||||
|
||||
echo $RESTIC_JSON | jq -r '.[]
|
||||
| {
|
||||
"hostname": .hostname,
|
||||
"username": .username,
|
||||
"short_id": .short_id,
|
||||
"time": ((((.time | split(".")[0]) + "Z") | fromdate) - (3600 * (.time | split("+")[1] | split(":")[0] | tonumber + 1))),
|
||||
"paths": .paths[]
|
||||
} | "restic_snapshots{hostname=\"\(.hostname)\",username=\"\(.username)\",short_id=\"\(.short_id)\",paths=\"\(.paths)\"} \(.time)"'
|
Reference in New Issue
Block a user