Add some healthchecks integration to backup
This commit is contained in:
@ -14,8 +14,11 @@ mkdir -p "$RESTIC_LOG_DIR"
|
||||
|
||||
# Run backup, and capture logs to file
|
||||
cron_backup() {
|
||||
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ healthchecks_id }}/start
|
||||
restic --verbose backup {{ restic_backup_locations|join(' ') }} | tee -a $RESTIC_LOG_FILE
|
||||
exit_code=${PIPESTATUS[0]}
|
||||
curl -fsS -m 10 --retry 5 -o /dev/null {{ healthchecks_host }}/{{ healthchecks_id }}/$exit_code --data-binary "@$RESTIC_LOG_FILE"
|
||||
rm $RESTIC_LOG_FILE
|
||||
echo "Exit code: $exit_code"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user