lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
330 stars 114 forks source link

Add support for webhooks #56

Closed enuuros closed 3 years ago

enuuros commented 3 years ago

This pull request adds support for triggering webhooks from the post-backup.sh hook using curl.

Instead of adding support for a specific platform (Teams, Slack, etc.) using environment variables, this just makes it possible to call curl from the post-backup.sh hook. Most likely users will want to control the formatting of messages which requires platform specific code. The hook also gets a parameter (return code of the restic backup command) so the user can decide if they want notifications always or only on failure.

Also removed the exit 1 when backup fails since it prevented notifications on backup failure. If a backup fails, we especially want to be notified about it.