From f057a9e7e66fbd011fdc48f361be7a68022abb5e Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Mon, 27 Nov 2023 10:51:07 +1100 Subject: [PATCH] Adding script for telegram reporting --- report_telegram.sh | 13 +++++++++++++ report.sh => report_zabbix.sh | 0 2 files changed, 13 insertions(+) create mode 100755 report_telegram.sh rename report.sh => report_zabbix.sh (100%) diff --git a/report_telegram.sh b/report_telegram.sh new file mode 100755 index 0000000..0fdc2ca --- /dev/null +++ b/report_telegram.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Feed backup status info to a telegram bot + +ONLYFAILED=0 # 0=send full report. 1=report only on failed backups +BARE=/root/scripts/bare/bare.sh +SENDER=/root/scripts/telegram-send/telegram-send.sh + + +text=$($BARE -T -a check) +[[ $ONLYFAILED -eq 1 ]] && text=$(egrep -v '^.*OK.*:' <<<"$text") +if [[ -n $text ]]; then + $SENDER "$text" +fi diff --git a/report.sh b/report_zabbix.sh similarity index 100% rename from report.sh rename to report_zabbix.sh