How to list all backup jobs from cli?

How can I list all backup jobs from cli?
And how can I get the stats for each job? The info that is available in GUI such as last run and last status?

Is there API documented for this? I’m not able to find it.

Thank you.

You may want to check this out:

1 Like

This is great, thank you, I’ll check it out.

Still I’m wondering, is it possible to list backup names and their last status with the duplicati CLI?

AFAIK, the included commandline utilities do not provide access to the scheduler, backup configurations and statistics. External tools like @Pectojin 's Duplicati-Client mentioned by @drwtsn32 provide this functionality.

The commands FIND and COMPARE that are included in Duplicati can give limited information about a specific backup version.

You can also subscribe to Duplicati-Monitoring. The HTTP reports that were received by the service, are visible in a nice looking graph that can be used to find large and small backups.

1 Like

I second the recommendation for using that Duplicati-Monitoring site. It is fantastic!

Gents, the Duplicati-Monitoring is indeed great, I’ve just checked it out. Kudos.
As it happens, I’ve build for our internal purposes very similar monitoring with Graylog (we’re using free version, works like charm).

With that said both solutions have inherit problem. What if duplicati process dies or hangs? What if the particular backup job dies and never sends the report? Or other system issue?

For business purposes I can’t rely on “self reporting” I need 2nd tool that will monitor backups. It can be anything but in simplistic approximation it would be a cron job regularly checking that duplicati processes are up, pulls down all configure backup jobs names and their last run status and schedule. And this is reported to central monitoring.

For this purposes I need simple means to access duplicati from CLI and to basis checks. The duplicati-client is indeed capable, but too big/complex to reliably run on Synology which is our main platform. Here we can’t say what next DSM brings in terms of changes and dependencies and the simpler the tool the better.

My original dream with the client I wrote was to have it run separately in a sort of service mode and report to a central server. I didn’t really get that far yet.

However if you can trigger calls to the client and parse the output you can get the status independently of the duplicati server itself and then log that.

You could probably even log the output and then have your log agent feed that to graylog.

Duplicati-Monitoring covers me in these situations. I get a daily email report and it starts to warn if a backup hasn’t happened recently (time frame is customizable).

1 Like

I note that didn’t say Duplicati server is too big/complex. If the server is running, the client could be remote.

It sounds like the backup schedules might be unpredictable and not standardized, so monitor must adapt?

You could certainly build one that “learned” the expected rhythm, but startup and changes are less reliable.

To follow up, I’ve figured out how to get the backup info in simple way (works with native tools)
This doesn’t work on Synology yet however …work in progress.

#!/bin/bash

function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }

x=$(curl -s -I -X GET http://localhost:8300/ | grep xsrf-token | sed -e 's/.*xsrf-token=\(.*\); expires.*/\1/')
token=$(urldecode "$x")

curl -s -H "x-xsrf-token: $token" http://localhost:8300/api/v1/backups
1 Like