Adding script for telegram reporting

This commit is contained in:
Rob Pearce 2023-11-27 10:51:07 +11:00
parent 135aa0b292
commit f057a9e7e6
2 changed files with 13 additions and 0 deletions

13
report_telegram.sh Executable file
View File

@ -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