fix(borg): update roles/borg/templates/borgmatic.yml.j2
This commit is contained in:
parent
baa3d2f908
commit
6ef859898c
1 changed files with 1 additions and 17 deletions
|
|
@ -28,23 +28,7 @@ before_backup:
|
|||
|
||||
after_backup:
|
||||
- curl -fsS -m 10 "https://status.guck.tv/api/push/borg-{{ inventory_hostname }}?status=up&msg=OK&ping=" || true
|
||||
- >-
|
||||
bash -c '
|
||||
STATS=$(borgmatic info --archive latest --json 2>/dev/null | python3 -c "
|
||||
import sys,json
|
||||
d=json.load(sys.stdin)[0][\"archives\"][-1]
|
||||
s=d.get(\"stats\",{})
|
||||
print(json.dumps({
|
||||
\"host\":\"{{ inventory_hostname }}\",
|
||||
\"status\":\"ok\",
|
||||
\"duration_sec\":int(s.get(\"duration\",0)),
|
||||
\"original_size\":s.get(\"original_size\",0),
|
||||
\"deduplicated_size\":s.get(\"deduplicated_size\",0),
|
||||
\"compressed_size\":s.get(\"compressed_size\",0),
|
||||
\"nfiles_new\":s.get(\"nfiles\",0)
|
||||
}))" 2>/dev/null || echo "{\"host\":\"{{ inventory_hostname }}\",\"status\":\"ok\"}");
|
||||
curl -fsS -m 10 -X POST -H "Content-Type: application/json" -d "$STATS" "http://10.1.1.111:9999/api/push" || true
|
||||
'
|
||||
- /usr/local/bin/borg-sentinel-push --host {{ inventory_hostname }} || true
|
||||
|
||||
on_error:
|
||||
- curl -fsS -m 10 "https://status.guck.tv/api/push/borg-{{ inventory_hostname }}?status=down&msg=FEHLER&ping=" || true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue