Last backup monitoring

I like to have the check command extended:
I wish to have an option which can calculate the time which has past since the last successful backup.
In case of problems or a duplicacy crash this check command could make sure that the backups are not too old and the user can react in case of problems. The idea is to take the timestamp of the last revision and compare it with the actual time stamp.
The user should be able to define a threshold for a warning via mail in hours or minutes.

2 Likes

Maybe better to send status to monitoring site ?
for example duplicati sent information to it’s monitoring site. And all statistics are available from one page.
https://www.duplicati-monitoring.com/

My post is a little about something else, but it would be a good addition.

Hi @Usefulvid !
I’m a CLI user only but I certainly see your point.

If duplicacy can log results to a file, you could make an external script to check for log age, or last success, but calculating time since last backup might not be that easy.

As @Arty.R says, although not quite what you have in mind, I think a http report feature would solve the challenge, and with the added benefit of being able to report even if duplicacy is not working.

Services like healthchecks.io (which was mentioned in Some thoughts to the WebUI ) solves this well. (duplicati-monitoring.com too but is designed to receive specific details from Duplicati, and might not be licensed for this use even if you could format Duplicacy’s output to match. I have not checked!)

For GUI users I think it would be nice with an option to specify a http report URL for a backup or copy job.

And perhaps this is technically possible to implement in :d: Gui/CLI without changing too many things.

Perhaps options like this could be implemented in the json files (to be added by CLI add-command or GUI options), and then the backup and copy commands could use these settings to report results on success. (or different URLs for different status) (Not specific to healthchecks.io but would be compatible) Customizable body for http POST would be great but a simple GET URL would be enough to use healthchecks.io.

For advanced users, or for some other reporting services, a customizable user-agent string and body could be useful, but again, not necessary to make this work with healthchecks.io.

These options would perhaps benefit CLI users too, although a script can be used to customize more details in the http report with data from duplicacy output. (I get number of files and size in the healthchecks.io log)

I brought him only as an example - a very convenient service

1 Like

To be honest: I newer will use any external service. I have my own devices in my home network running and do not want to rely on foreign webservices (for security and privacy reasons).
A simple timestamp mechanism and a mail trigger which I proposed would be an easy solution to the monitoring issue I think :slight_smile:

Why?
having 2 timestamps (the one from the last backup and the timestamp of now) does not looks to complicated for me or do I miss something?

Me too but even for the cli this should be the same mechanism.
It could be made without the mail trigger but If I could get a value for the time difference I could do an easy bash script which can trigger sendmail

No, you are correct, but I was thinking about a more mainstream general case with a GUI user with perhaps limited scripting skills/tools! Plus I assumed from your posts in the thread Some thoughts to the WebUI that this was a feature requrest with GUI in mind! :stuck_out_tongue_winking_eye:

If you script CLI, you can of course easily log last status (or all of duplicacy output) to a file and compare dates. (file date vs now) Or perhaps you could check the date/time of the last snapshot in repository and compare with “now”. (Not sure if this works for all storage types since it’s in the Cache folder)

I feel that if you need to script the actions anyway, the time difference can be calculated in script. Then sendmail or http report or what the user wants :slight_smile:. Perhaps it could be added to the output from the -stats option. But also to retrieve this particular detail from the output, you would then have to do more stuff in the script, so I’m not sure how much you gain.

I don’t mean to say it’s a bad idea though!
Some products sets (Windows) environment variables for backup result and some more details, meaning the results are immediately available for the script after the backup is done. (in addition to exit code which Duplicacy already provides of course)

Healthchecks is open source. You can run it on your own machine:

I just realize: isn’t this feature request closely related to this one:

In that case, you migh want to follow up over there because it looks like there is a chance of getting it implemented…

I noticed my backups on one device not working anymore, so I found this thread, and I’d love this to be implemented or find a nice solution. Does anybody of you have a script that calculates the delta? Also wanted to combine it with healthchecks.io

Ah just found this: Monitor backups status using healthchecks.io (Windows/CLI)