Add hooks variable to config template. By @lukasleitsch (#40)

This commit is contained in:
Lukas Leitsch 2020-11-03 09:43:33 +01:00 committed by GitHub
parent 54c270acdc
commit 0a490a3a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/borgba
- `borgmatic_failure_command`: Run this command when an error occurs. E.g. `curl -s -F "token=xxx" -F "user=xxx" -F "message=Error during backup" https://api.pushover.net/1/messages.json`
- `borgmatic_before_backup_command`: Run this command before the backup. E.g. `dump-a-database /to/file.sql`
- `borgmatic_after_backup_command`: Run this command after the backup. E.g. `rm /to/file.sql`
- `borgmatic_hooks`: Hooks to monitor your backups e.g. with [Healthchecks](https://healthchecks.io/). See [official documentation](https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/) for more.
- `borgmatic_failure_command`: Run this command when an error occurs. E.g. `curl -s -F "token=xxx" -F "user=xxx" -F "message=Error during backup" https://api.pushover.net/1/messages.json`
- `borg_exclude_patterns`: Paths or patterns to exclude from backup. See [official documentation](https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns) for more.
- `borg_one_file_system`: Don't cross file-system boundaries. Defaults to `true`

View File

@ -7,6 +7,7 @@ borgmatic_failure_command:
- echo "`date` - Error while creating a backup."
borgmatic_before_backup_command: []
borgmatic_after_backup_command: []
borgmatic_hooks: []
borg_one_file_system: true
borg_exclude_from: []
borg_encryption_passcommand: false

View File

@ -171,3 +171,7 @@ hooks:
{% for cmd in borgmatic_failure_command %}
- {{ cmd }}
{% endfor %}
{% for hook in borgmatic_hooks %}
{{ hook }}: {{ borgmatic_hooks[hook] }}
{% endfor %}