Hi
Is it possible to edit an existing backup job with a command line ?
Thanks for your help
ServerUtil in the new Beta 2.1.0.2 may help, but editing a job export is not always easy.
If you mean something that gives you scrolled interactive guidance, that’s not available.
If this isn’t enough of an answer, please clarify your situation and what you intend to do.
For instance, I would like to change the scheduled time of the existing job or the destination path.
I install Duplicati on many computers and a script to automate this kind of modification
would be extremly useful
Preload settings is another new feature, with a syntax that’s documented (unlike job export).
Example Scripts shows how you can change things on the fly before backup, if that will help.
For example DUPLICATI__REMOTEURL
can change destination URL based on what script says.
I suspect changing schedule will be harder, but it’s in the job export/import if nowhere else…
You can certainly run Duplicati with your own maintained scheduler, if that fits your use case.
“Export as Command-line” will provide a job’s command line, which you can have scheduled.
Command line also supports parameters-file where you can put options for the scheduler job.
Another new paid feature is the Agent. It’s still in progress, but there’s a little bit about it here:
The Agent package is still a bit new, so at this point it is mostly intended for enterprise-style installations where many machines needs to be configured and managed centrally.
Agent in the new documentation doesn’t tell me much more, but developer could answer.
The use case might determine which to use, e.g. is local user supposed to run Duplicati?
There is no documentation directly for job export, but the export uses the Duplicati commandline interface which is documented.
I understand the technical requirement for this, but I am do not understand the setup enough to understand why. What situation would cause you to want to adjust, say scheduled time, from a script?
For the time part, you could also have backups with no schedule in Duplicati, and then use a different scheduler to manually trigger the backups from the commandline.
If this is during the initial installation, then you can set up a backup on one machine, to have a template. You can then use ServerUtil or the UI to export the configuration.
The exported JSON file can then be edited (manually or scripted) and imported with ServerUtil on the new machines.
A more crude version of this is to copy Duplicati server.sqlite
, modify it, and install it on the new machine.
The Agent is (among other things) intended to be an easy way to manage a large set of installations. It does not support scripting though.
Again, I think I need to understand the setup a bit better. If you want full control, I think the Duplicati CommandLine Interface is the best choice. It does require you to handle scheduling, logging, etc., but the price for more control is usually more responsibility.
Thank you for all your responses. However, I found a solution that meets all my needs by using sqlite3.exe, which allows me to directly modify Duplicati-server.sqlite in real time. It’s wonderful!
The database is the ultimate authority, but even less documented than job export file format.
One worry about the latter though is that I don’t see a way to delete the old job. Docs advise
Note that this will create a new backup with the same configuration, so make sure you have removed the previous backup configuration first.
but I’m not seeing that ServerUtil can do that. If that’s true, it might prevent export/edit/import.
That seems almost a contradiction, unless whatever manages the agent can have automation.
There is now an overview of the data schema. But it is lacking some explanations on how the filters are used to combine schedule and backup, and how options are internal/global/backup specific etc.
I would say that the danger is that the database is sometimes updated and that changes to the database may prevent it from upgrading, or upgrades may prevent the external queries to run.
There are no constraints for this, so you can really mess up the database, but unless you start changing the schema, I would say it is a fair risk for the benefits, assuming you are well versed in SQL.
True. ServerUtil cannot edit or delete backup configurations. Feel free to create an issue requesting this. It is quite straightforward to implement if there is a need.
Maybe this is clearer then: You can manage a large set of machines via a shared UI, but you cannot access the agent locally (= no scripting as the OP wants).