i am currently thinking About creating an application for Windows that is a ui for restic and i was wondering About how to interface with restic for Progress results, snapshots etc.
Could you tell me if there is some machine readable Output or do i basically have to fallback to parsing using some regex magic?
Most commands accept a
--json switch and will send a JSON representation to standard output, which should be easy to parse.
I don’t know if or how
restic backup uses this switch, though. I doubt that it will send progress updates since restic only sends complete JSON objects (progress updates would require sending an object for each update).
This is something we’re contributing to restic for Relica.
@Confuset, have you looked at Relica? It’s essentially a glorified cross-platform UI for restic (which some extra features on top, like the ability to easily back up to other computers, even friends’ computers). Any reason you need to build your own?
as fa as I know, restic can send output and progress status only with stdout, with human readable output or in json format.
In our enviroment we created a OS independent web-GUI that control restic inside a big client-server backup project. For do it we patched restic for send http-post status every N seconds to a localhost web server (python+flask) that receive the data, process it, save it on a sqlite db and after send them to a central server. The local part of code allow also the user to show snapshots and restore data (chosen from a html5 treeview). The central server part is multi-tenant web gui (developed with codeigniter) that receive the info data from the client and display it into some js “datatable”
We don’t have publish the code yet (basically for lack of time) but in the next few months we’ll share all the code with a FLOSS licence
The patch are visible here:
We know that we didn’t follow the “normal” mode of work with restic team when we sent patchs, but we had some problems to solve and we run for end them.
Also here in the near feature we’ll be more collaborative with the fantastic restic team!
Our PR is here, by the way: https://github.com/restic/restic/pull/1944
It adds streaming JSON output for
restic backup --json. Eventually hopefully we’ll have progress for restores and prunes and checks, too.
thanks for pointing that out. There is actually no direct reason not to use Relica.
But I was thinking about Building something by myself for Training, and with a native Windows application, i might be able to reach better Integration into Windows later on.
thanks for pointing the
--json Option out.
I will look into that.
thanks for that PR. No I just have to wait for that to be integrated to get the progress.