Duplicati API running on Windows

I didn’t find more information about automating Dulicati API running on the Windows platform. Can you provide me a link to the page where I can find more information about Duplicati API?

Is it possible to use PowerShell:

  • to create all necessary configuration of FTP/SFTP jobs/configuration (e.g. define all necessary data, home folder, destination server, username/password, etc)?
  • get progress status when a job started
  • list of files transferred to FTP/SFTP server
  • status of transfer (success, failed)

Thanks in advance
Vlad

I don’t think anyone has documented the API, so you need to dig around a bit.

The API is exposed via these classes:

The general structure is that /api/v1/acknowledgements maps to /RESTMethods/Acknowledgements.cs

You then need to look at the GET, POST etc methods inside, like here:

There is an example Python script here that performs the authentication steps and calls the pause/resume commands:

To answer each of the task you are looking at:

You can use the import feature, or POST a JSON document with the desired setup (try exporting one and have a look at the format).

There are no callback hooks, but you can register a custom script that is called when the backup is started, which can call something else. During the backup you can poll the status (should be /api/v1/serverstatus).

Source files or target files? The progress will emit some names, but there is not really a good way to get all the source file names (it takes up a lot of space). The remote destination filenames are not reported, but you can get the combined size and number of files.

Yes, I think that is a GET to /api/v1/backup/<id> and it includes a parsedresult code.

One thing I wonder about is what the term “API” refers to. PowerShell (or a batch file) can also go about Using Duplicati from the Command Line which is documented. A question is – what schedules backups?

If the automation scripts do it and are able to notify you somehow when backup starts, then you have all that’s requested except for a list of files transferred – but these files are not source files. Is info relevant?

Scripting options

Reporting options

https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.bat

If the goal is to have Duplicati’s scheduler schedule jobs, then it’s harder because server is independent of command line. Here are some ideas for ways to manage backup jobs done by server, using scripting.

Thank you both for information.