feat: add backup-status push hook to borgmatic template
This commit is contained in:
parent
eab92ac29f
commit
152edb8345
1 changed files with 35 additions and 0 deletions
35
roles/borg/templates/borgmatic.yml.j2
Normal file
35
roles/borg/templates/borgmatic.yml.j2
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
repositories:
|
||||||
|
- path: {{ borg_repo }}
|
||||||
|
label: storagebox
|
||||||
|
|
||||||
|
source_directories:
|
||||||
|
{% for path in backup_sources %}
|
||||||
|
- {{ path }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
ssh_command: ssh -i {{ borg_ssh_key }}
|
||||||
|
remote_path: {{ borg_remote_path }}
|
||||||
|
encryption_passphrase: "{{ borg_passphrase }}"
|
||||||
|
compression: {{ borg_compression }}
|
||||||
|
archive_name_format: '{{ inventory_hostname }}-{now:%Y-%m-%d_%H-%M}'
|
||||||
|
|
||||||
|
keep_daily: {{ borg_retention_daily }}
|
||||||
|
keep_weekly: {{ borg_retention_weekly }}
|
||||||
|
keep_monthly: {{ borg_retention_monthly }}
|
||||||
|
|
||||||
|
checks:
|
||||||
|
- name: repository
|
||||||
|
frequency: 2 weeks
|
||||||
|
- name: archives
|
||||||
|
frequency: 4 weeks
|
||||||
|
|
||||||
|
before_backup:
|
||||||
|
- echo "[$(date)] Starte Backup auf {{ inventory_hostname }}"
|
||||||
|
|
||||||
|
after_backup:
|
||||||
|
- curl -fsS -m 10 "https://status.guck.tv/api/push/borg-{{ inventory_hostname }}?status=up&msg=OK&ping=" || true
|
||||||
|
- curl -fsS -m 10 "http://10.1.1.111:9999/push?host={{ inventory_hostname }}&status=ok" || true
|
||||||
|
|
||||||
|
on_error:
|
||||||
|
- curl -fsS -m 10 "https://status.guck.tv/api/push/borg-{{ inventory_hostname }}?status=down&msg=FEHLER&ping=" || true
|
||||||
|
- curl -fsS -m 10 "http://10.1.1.111:9999/push?host={{ inventory_hostname }}&status=error&msg=Backup%20fehlgeschlagen" || true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue