1
0
forked from finallycoffee/base

feat(restic): migrate to systemd template units

This commit is contained in:
2025-03-09 13:07:03 +01:00
parent ed95d4fd3d
commit 0aba4024de
14 changed files with 231 additions and 147 deletions

View 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)"'