sending mail after successful backup

In case you want cron to tell you that your backup job has been finished you can use MSMTP to send you the logs for your cronjob via e-mail:

After install with apt-get install mstmp, setup aliases in your /etc/aliases file:


Then make sure your config in /etc/msmtprc looks something like this:

# Set default values for all following accounts.
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account gmail
from <user>
auth on
user <user>
password <your password>
# Set a default account
account default : gmail

Then you are ready to test:

echo -e "Subject: msmtp test\nhello test." | msmtp

To make the finished cron job send the mail add something like the following to your /etc/crontab or crontab -e

* * * * *   /scripts/ 2>&1 | msmtp