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.
-
Open Duplicati
-
Click on Settings.
-
Scroll down to “default options” and click on “edit as text”.
-
Copy the text block below, and paste it into the “Options” text box
Text block you need to copy
--
send-mail-url=smtp://smtp.gmail.com:587/?starttls=when-available
--
send-mail-any-operation=true
--
send-mail-subject=Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%
--
send-mail-to=destination_email_address@whatever.com
--
send-mail-username=your_sending_gmail_username@gmail.com
--
send-mail-password=your_sending_gmail_password
--
send-mail-from=This_computers_name backup <your_sending_gmail_username@gmail.com>
-
Click on the “Edit as list” button
You will now see 7 advanced options.
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