Add Borg local sync system service and configuration
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 12s
Nix Format Check / check-format (push) Failing after 25s
Python Lint Check / check-python (push) Failing after 8s

This commit is contained in:
2025-07-28 23:15:49 +02:00
parent 63bd5ace82
commit 76c2586a21
10 changed files with 426 additions and 13 deletions

View File

@@ -26,6 +26,7 @@ log() {
# Telegram notification function
send_telegram() {
local message="$1"
local silent="${2:-false}"
if [ -z "$TELEGRAM_BOT_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then
log "Telegram credentials not configured, skipping notification"
@@ -36,7 +37,8 @@ send_telegram() {
{
"chat_id": "$TELEGRAM_CHAT_ID",
"text": "$message",
"parse_mode": "HTML"
"parse_mode": "HTML",
"disable_notification": $silent
}
EOF
)
@@ -129,7 +131,7 @@ if [ $global_exit -eq 0 ]; then
📊 Repository: {{ borg_repo_dir }}
🕐 Completed: $(date '+%Y-%m-%d %H:%M:%S')
All operations completed without errors."
All operations completed without errors." "true"
elif [ $global_exit -eq 1 ]; then
log "Backup completed with warnings (exit code: $global_exit)"
send_telegram "⚠️ <b>Borg Backup Warning</b>