bare/report_telegram.sh

14 lines
352 B
Bash
Executable File

#!/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