Add notification feature to backup scripts for various services

Enhance backup scripts for Nextcloud, Gitea, Paperless, Vaultwarden, Immich, and VPS configurations by adding Telegram notifications upon completion. Include details such as backup size and objects backed up. Update backup documentation to reflect these changes and ensure clarity on backup processes and retention policies.
This commit is contained in:
2026-02-27 20:42:30 +03:00
parent 56cee83198
commit f319133cee
21 changed files with 1048 additions and 168 deletions

View File

@@ -21,3 +21,12 @@ chmod 600 "$BACKUP_ROOT"/etc-pve-*.tar.gz "$BACKUP_ROOT"/etc-host-configs-*.tar.
find "$BACKUP_ROOT" -name 'etc-pve-*.tar.gz' -mtime +$RETENTION_DAYS -delete
find "$BACKUP_ROOT" -name 'etc-host-configs-*.tar.gz' -mtime +$RETENTION_DAYS -delete
NOTIFY_SCRIPT="${NOTIFY_SCRIPT:-/root/scripts/notify-telegram.sh}"
if [ -x "$NOTIFY_SCRIPT" ]; then
SIZE=$(du -sh "$BACKUP_ROOT" 2>/dev/null | cut -f1) || true
BODY="Резервное копирование завершено.
Объекты: архивы /etc/pve, конфиги сети (interfaces, hosts, resolv.conf).
Размер копии: ${SIZE:-}."
"$NOTIFY_SCRIPT" "⚙️ Конфиги хоста" "$BODY" || true
fi