tiredofit / docker-db-backup

Backup multiple database types on a scheduled basis with many customizable options
MIT License
893 stars 128 forks source link

Not getting Email Notification #364

Open ShlomiPorush opened 3 months ago

ShlomiPorush commented 3 months ago

Summary

Hi, for some reason I don't receive an email after the backup is complete. i dont see any error in logs

Relevant logs and/or screenshots

My docker compose file with the relevant part of the alerts

version: '3'
services:
  db-backup:
    image: tiredofit/db-backup
    environment:
      # Notifications
      - ENABLE_NOTIFICATIONS=TRUE
      - NOTIFICATION_TYPE=EMAIL
      # Email
      - MAIL_FROM=${MAIL_FROM}
      - MAIL_TO=${MAIL_TO}
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_PORT=25

Logs

2024-08-14 12:00:00 IDT [notice] Found PRE_SCRIPT environment variable. Executing '/scripts/mysql-pre-script.sh
2024-08-14 12:00:00 IDT [notice] Dumping MySQL/MariaDB database: '*****' and compressing with 'gzip'
2024-08-14 12:00:02 IDT [debug] DB Backup exit Code is 0
2024-08-14 12:00:02 IDT [info] DB Backup of '******_20240814-120000.sql.gz' completed successfully
2024-08-14 12:00:02 IDT [notice] Backup of '******_20240814-120000.sql.gz' created with the size of 6651723 bytes
2024-08-14 12:00:02 IDT [debug] Moving backup to filesystem
2024-08-14 12:00:02 IDT [debug] Move exit Code is 0
2024-08-14 12:00:02 IDT [debug] Moving of backup '********_20240814-120000.sql.gz' completed successfully
2024-08-14 12:00:02 IDT [notice] Found POST_SCRIPT environment variable. Executing '/scripts/mysql-post-script.sh
2024-08-14 12:00:03 IDT [notice] DB Backup for '******' time taken: Hours: 0 Minutes: 00 Seconds: 02
2024-08-14 12:00:03 IDT [info] Cleaning up old backups on filesystem

Environment

Docker on ubuntu server

beyerleinf commented 2 months ago

(not a contributor) but I got caught out by that as well. From the code, (I think) it's only sending a notification if the backup failed and it seems intentional.

rltas commented 2 months ago

Some way to test this would be great, either an option to send a mail on success too, or a cli command in the container or whatever. I can tell that echo Test | sendmail -f noreply@mydomain.net me@mydomain.net works but who knows if that's also true for the notifications. One simple way to test it by provoking an error is to set the /backup mount to ro.