bbtsoftware / docker-mssql-backup

Docker image for periodic backups from a Microsoft SQL Server container
MIT License
29 stars 19 forks source link

Add email support (GH-23) #37

Closed eoehen closed 3 years ago

eoehen commented 3 years ago

Extracted from PR #25 by @pfeigl

eoehen commented 3 years ago

@pfeigl My tests dosn't send any emails. Do you have an idea why?

pfeigl commented 3 years ago

I also had some problems. What you can do is the following:

pfeigl commented 3 years ago

Btw, you can use this to also get mail stdout and stderr into the cronlog echo "$cronSchedule . /container_env.sh; /usr/local/bin/backup.sh 2>&1 | tee -a /var/log/cron.log | mail -s 'SQL Server Backup Result' $MAIL_TO 2>&1 | tee -a /var/log/cron.log"

pfeigl commented 3 years ago

The -a (append) is important, I missed them in my initial version - this would truncate the cron.log over and over again.

eoehen commented 3 years ago

The -a (append) is important, I missed them in my initial version - this would truncate the cron.log over and over again.

Thank you for your input, it was helpful to find the problem. But I am not sure if we should use the append parameter (-a). I think in this case we should have the control about the growing of the logfile.

I create a new Issue for this #39

eoehen commented 3 years ago

@pfeigl My tests dosn't send any emails. Do you have an idea why?

Now I could test it with PaperCut Without TLS and AUTH.

pfeigl commented 3 years ago

Great. I tried with mailtrap and office365 servers and both worked great (also with tls and auth).