Duplicacy and push notifications to phone [Guide]

I just wanted to share how I configured my Duplicacy home server install to push status notifications to my phone after job completion.

I didn’t want daily mails on job completion, since I prefer a phone notification for stuff like this. I’ve used Pushover before with success, so as soon as I saw that you could post to a URL on completion I decided to implement push notifications for my schedule as well.

You will need:

  • A Pushover account. https://pushover.net/. I am not affiliated with Pushover. They give you a 30 day trial, after that it’s a one time cost for all your personal devices (4.99$ right now). They give you 7500 free notifications a month, which should suffice to any home server needs you might have.
  • Pushover app installed on your phone (Android or iPhone).
  • A working Duplicacy install with at least one scheduled backup.
  1. Create an Application in Pushover. This gives you an API token. This token can be used by anyone to push notifications to your phone, so keep it safe :slight_smile:
  2. Create a report.tmpl in your .duplicacy-web directory in order to craft the correct JSON payload for Pushover. You can find your User token on the Pushover dashboard.
    My template looks like this:
    {
    “BackupResult”: “{{.result}}”,
    “BeginTime”: {{.start_time}},
    “TotalFiles”: {{.total_files}},
    “Storage”: “{{.storage_url}}”,
    “token”: “YOUR_APP_TOKEN”,
    “user”: “YOUR_USER_TOKEN”,
    “message”: “Backup {{.result}}. {{.total_files}} files in {{.directory}}”,
    “title”: “Backup Completed”
    }
  3. Configure the report address in the UI:
    backup_report
  4. Upon completion you should receive a notification like this:
  5. You can see what’s possible with the push notification here: Pushover: API

I hope someone can use this small guide :slight_smile:

5 Likes

Great Post! Can you do the same for the CLI version?

But why though? Isn’t the goal to minimize distractions in life, not add more noise in the form of useless notifications? It’s not like it’s an emergency or like you need or even able to address it right away.

Backup is a background low priority task. Unless if failed 10 times in a row I don’t want to know about it even in the form of email, let alone push notification (I have all notifications disabled on my phone for that matter. Including for texts for all but a narrow circle of people). I’ll get to checking email when I feel like it, but even email is too vocal for a backup service.

Just my 0.02.

I think we’re in a technical forum about Duplicacy and not in some life hacking/zen forum. I came here to learn about Duplicacy related tips and tricks and not to hear that my goal in life is wrong. But hey, to each his own.

2 Likes

Technology exists to help address real world problems. Adding more noise to a real world is not a problem that requires solving. Often instead of grinding through granite to the solution it’s worth to stop and re-assess – perhaps it’s a wrong problem to need to solve? And the forum also exists to express opinions. That was my opinion.

BTW, I meant to post that comment to the topic, not in response to your comment, sorry about that.

Some phones these days have a ‘silent’ notification section which can be good for when you want to look at relevant happenings at a glance and not get distracted…

While I wouldn’t use push notifications myself, I can see such a thing being pretty darn useful when, for instance, you’ve set up a number of clients with Duplicacy and need to know ASAP when they’ve failed - especially when you have another alert saying their site is offline and you wanna make darn sure there’s a recent-ish backup and access to their systems isn’t yet possible.

Backup is one of the absolutely highest priorities as far as I’m concerned. Although it would be nice (and probably easy to script outside the GUI) a system where say 3 failures in a row would trigger a report / notification.

Anyway, there’s plenty of use cases so thanks for the instructional, @morten.vitved

2 Likes

Thanks for this tip, Morten!
I see that Pushover can be integrated with healthchecks:
https://healthchecks.io/integrations/add_pushover/

Normally I use healthchecks with the mail integration (mail which I receive on my phone), but this is another alternative that can be useful. Using healthchecks and Pushover, you will get the push notification only when there is a missing backup or other problem (anything that prevents backup success signal). You will also get monthly mail reports about the status; helpful if total silence is scary!

Since you use Web GUI you can set up :d: to report to healthchecks.io like this:
Alert if no recent backups?
or if using CLI/commandline:
Monitor backups status using healthchecks.io (Windows/CLI)

Because I needed it. Minimizing distractions is fine. Not knowing the status of my backup is a distraction for me. The notification isn’t. I needed this and wanted to share it.

Backup is not a low priority task for me in this case. I want to know the status of my daily backup, and a notification works for me. An email I have to act on. This I just swipe and move on.

You could change the report template to only notify on fails or do some other filtering if you’d like. There are possibilities to finetune this in both duplicacy and Pushover.

1 Like

You keep calling it noise. This is not noise for me. I had a problem. I solved it.

1 Like

This is a great idea! I love it.

It’s not working for me unfortunately.

I followed your instructions but it’s not working.

Do you need to specify the URL on the Pushover Website for the “app” you create for this?

Do you create the report.tmpl file directly in the .duplicacy-web directory?

Check out this more recent thread regarding how to set up Duplicacy with Pushover:

It should still work. Mine has kept trucking since I made this post. No need to define where the message comes from in pushover, it solely relies on your api token being supplied. report.tmpl needs to be in the .duplicacy-web dir which should be possible with the popular docker image.

Thanks for this useful guide, managed to get woking with a bit of help from THIS thread too.

Don’t suppose any one knows of a way to restrict notification to failed backup jobs only?

For Gotify notifications, I use report.tmpl

{
"BackupResult": "{{.result}}",
"BeginTime": "{{.start_time}}",
"TotalFiles": "{{.total_files}}",
"Storage": "{{.storage_url}}",
"message": "Backup {{.result}}. {{.total_files}} files in {{.directory}}",
"title": "Duplicacy Backup Completed"
}

And, Send report to
https://gotify.domain.com/message?token=qwerty12345

… and yes, I have extra variables in the report.tmpl file.