Pectojin / duplicati-client

A command line client for controlling the Duplicati Server
GNU Lesser General Public License v2.1
75 stars 20 forks source link

Question: How to get the status of the backup (success/failed)? #16

Closed mahadi closed 5 years ago

mahadi commented 5 years ago

I want to monitor the status of my backups automatically on notify myself if something broke. As the APi is not documented officially, i am trying to extract the simple information for each backup like "Status: Success/Failed" from the API using duplicati-client.

list backups only tells me when it was running the last time, but not if it was running successfully.

Can i get this information using the api directly or do i need to do additional queries? (Or write my own method?)

Pectojin commented 5 years ago

The Duplicati API doesn't provide that information directly, but it's for a good reason.

last run is only considering successful runs. If the backup doesn't complete it's not considered run.

So you can see that it succeeded if the last run time has been updated, but you'll want to look at list notifications to get informed both about errors actually stopping the backup and warnings that didn't break your backup.

You can also get the entire backup run log with duc logs backup --id 42, but it's a bit harder to parse.

mahadi commented 5 years ago

Ok, thanks for that information. Was not clear to me.