Merge pull request #1 from jpmens/jp1

optional healthcheck URL
This commit is contained in:
Alexander Rust 2017-09-04 19:59:27 +02:00 committed by GitHub
commit f5410c38e2
3 changed files with 10 additions and 0 deletions

View file

@ -6,3 +6,8 @@ Local includes and excludes in `/etc/backup/local.config` or `/etc/backup/local.
* `backup $REPO local` for local backup to repo configured by
* `backup $REPO monitor $HOST $WARN_HOURS $CRIT_HOURS` for Nagios/Icinga checks of backups
* `backup $REPO $ARGUMENTS` for invoking restic with $ARGUMENTS for the repository
In `local.config`:
* `BACKUP_HOSTNAME` is the name your host will show up as in restic
* `BACKUP_DIR` is the root of the directory you want to back up
* `HEALTHCHECK_URL` is an optional URL to [healthchecks.io](https://healthchecks.io/checks/) (comment out if you don't need it)

View file

@ -59,6 +59,10 @@ do_local_backup () {
. /etc/backup/local.config
$RESTIC --exclude-file /etc/backup/local.exclude backup --hostname $BACKUP_HOSTNAME $BACKUP_DIR
if [ -n "$HEALTHCHECK_URL" ]; then
curl -fsS --retry 4 "$HEALTHCHECK_URL" > /dev/null
fi
}
do_monitor () {

View file

@ -1,2 +1,3 @@
BACKUP_HOSTNAME="backuphost.example.org"
BACKUP_DIR="/"
# HEALTHCHECK_URL="<URL from https://healthchecks.io/checks/ to notify>"