How to configure automatic email notifications via gmail for every backup job


#1

This article explains how to configure automated email notifications via gmail at the conclusion of every Duplicati operation (backup, restore, etc.). With this approach, every Duplicati job on the machine will send automated notifications – you don’t need to configure each job individually.

You will now see 7 advanced options.

Screenshot 5

The first 3 do not need to be modified. The last 4 need to be modified as follows:

  • Replace destination_email_address@whatever.com with the email address you want the status message sent to.
  • Replace your_sending_gmail_username@gmail.com with the email address of the gmail account you are using to send the message. (Note that there are two places where you need to make this change)
  • Replace your_sending_gmail_password with the password of the gmail account you are using to send the message.
  • Replace This_computers_name with the name of the computer that the backup job is running on.

Click the “OK” button at the bottom of the screen to save your results.

You will now receive an email message at the conclusion of every Duplicati job that is run on the current computer.

This can generate a lot of email clutter – a report for every backup job run. There are two approaches to reducing the volume of email received.

My recommend approach is using dupReport.py to generate summary reports. This excellent tool was developed by @handyguy. If you do this, be sure to modify the “subjectregex=” line in dupReport.rc as shown below to ensure the summary reports work for either the default subject line or the subject line used in this writeup.

subjectregex = ^Duplicati ([\w ]*, |)Backup report for

You also need to add a filter to your email client to automatically move the duplicati-generated email’s out of your inbox and into an email folder which dupReport.py can process.

Alternatively, as suggested by @sanderson, below, you can add this setting:
--send-mail-level=Warning,Error,Fatal

The one downside to this approach is that it doesn’t differentiate between a backup job that succeeded and one that never ran, as the result of both conditions is that no email is sent. This is why I prefer the dupReport.py approach.

Enjoy!

Marc


Announcing dupReport - A Duplicati Email Report Summary Generator
E-mail notification problems to Gmail
Email confirmation after succesful backup / failure or issues
Email problem and Backup lock
#2

If you don’t want email on every backup, but only if there is a problem you can added this setting:

--send-mail-level=Warning,Error,Fatal

#3

Brilliant! Thank you.


#4

Thank you very much Marc_Aronson for posting your how-to it works great!
Until now I wasn’t able to find more clear instructions anywhere including this forum.


#5

Thanks for posting this little hint sanderson, it is really helpful!


#7

Hi Stephen, I don’t back up my google docs or email.

I back up my google photos by downloading them via Picassa periodically. I am thinking of switch from this to google takeout at some point.

Marc


#8

Thanks Marc,
but for me this line did not work, so I had to change it:
--send-mail-from=your_sending_gmail_username@gmail.com

P.S.
I do not use Gmail, but my personal email


#9

That’s strange – the notation:
Firstname Lastname <emailaddress@foobar.com>
is standard notation and works on 3 other machines I have configured with duplicati.

If your happy without the “from” email containing the name of the computer backed up, then all is well.

If you want help getting it to work the other way, then PM me your settings exported as text, with any passwords masking out.

THanks!

Marc


#10

Anyone knows why they just don’t add a simple EMAIL ALERT ACCOUNT SETUP within the DUPLICATI setup.
The tool is great, this should be a simple modification compared to all the coding already done.


#11

It just has not been done yet. But I agree, it’s pretty easy to implement :slight_smile:


#12

Did I just hear a volunteer? :wink:


#13

I’ll add it to the end of my to-do list so I can look at it next year :wink:


#14

Hi Marc_Aronson, thanks for the great guide, it works very well.


#15

Hey guys, just popping in here to request an update. Looks like you need to add quotes around the subject wording if you have spaces between words.

--send-mail-subject="Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%"

Also, this code needs to be added:

--accept-any-ssl-certificate=true


#16

I don’t know when/if something changed in dupReport, but this how-to needs to be updated to use Source-Destination Pairs.

This means using a --send-mail-subject line like the following (notice the “-My_Backup_System” portion):

--send-mail-subject="Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%-My_Backup_System"


#17

Hello @rinogo, welcome to the forum - and thanks for the reminder for any other new readers on this topic!


#18

Hi, original author here. When I get some spare cycles I’ll upgrade to the latest version to dupReport and update the howto.

Marc


#19

Hi there,

Thank you for this guide.

This may sound a bit obvious, but for the more distracted folks, like myself, you need to enable access for less secure apps in the Google account, or else Gmail will refuse the connection.

I fumbled around with the --send-mail settings of Duplicati for a couple of hours, pulling my hairs, before I remembered that I needed to do that.