From 41e897f4945aaf8fbcdf0b12ac2f08c5e6ae0458 Mon Sep 17 00:00:00 2001 From: doc Date: Mon, 30 Jun 2025 20:11:52 +0000 Subject: commit of legacy code --- dr_telegram_alert.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 dr_telegram_alert.sh (limited to 'dr_telegram_alert.sh') diff --git a/dr_telegram_alert.sh b/dr_telegram_alert.sh new file mode 100755 index 0000000..aaccda6 --- /dev/null +++ b/dr_telegram_alert.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Telegram Bot Token and Chat ID +TELEGRAM_BOT_TOKEN="8178867489:AAH0VjN7VnZSCIWasSz_y97iBLLjPJA751k" +TELEGRAM_CHAT_ID="1559582356" + +# Function to send Telegram message +send_telegram_message() { + local message="$1" + curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \ + -d chat_id=$TELEGRAM_CHAT_ID \ + -d text="$message" > /dev/null +} + +# Check if it's the first of the month and send a reminder +current_day=$(date +%d) +if [ "$current_day" -eq "01" ]; then + send_telegram_message "Reminder: It's the 1st of the month! Please run a disaster recovery drill and test restore on all datasets." +fi -- cgit v1.2.3