garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.72k stars 50 forks source link

Add support for long-running restic commands #505

Closed oliver-la closed 1 month ago

oliver-la commented 1 month ago

Just remembered I never created a feature request for this. At last, here it is. :)

Is your feature request related to a problem? Please describe. Backrest currently runs custom commands in the foreground/browser and cancels the execution when the browser is closed or the connection interrupts. It's therefore unsuitable to run commands that may take a long time. For example, I'd like to run prune with extra flags which is going to take quite some time.

Describe the solution you'd like The commands should be sent to the background. A new entry both in the Tree View and Operation List of the repository should appear, with a visual indication of the command's status. (running/ended/failed) As a user I should also be able to view the output of the command.

Or, as Gareth put it:

My current idea is to eventually introduce a new operation type + task type for custom commands that will be tracked in the operation log (and support all the normal task features like cancellation, output and log tracking, etc). I'll likely implement some small condensed display for recently run custom command output in the Run Command view.

Discussed in https://github.com/garethgeorge/backrest/discussions/482

Originally posted by **oliver-la** September 19, 2024 The web ui currently allows to run a custom restic command, with the caveat that it's only intended for commands that complete in a short time. I'd like to run a prune with a couple extra flags. Since it will take a long time, I probably(?) can't do it via the Web UI.
SerVB commented 1 month ago

Backrest definitely works for me without opening the browser, so the main point that it cancels the execution when the browser is closed isn't clear to me. I'm on Windows, perhaps you use a different OS? Please clarify

oliver-la commented 1 month ago

@SerVB I think you misunderstood. This is regarding the "Run Command" feature in the web UI. Not about executing backrest itself.

garethgeorge commented 1 month ago

Right — thanks for making an issue to track this. It’s definitely in my plans to make command executions into entries in the operation history.

I expect to get to this sometime in the next month.

garethgeorge commented 1 month ago

Implemented in https://github.com/garethgeorge/backrest/pull/516

oliver-la commented 1 month ago

@garethgeorge That was super quick, thank you so much! <3 I'm gonna go ahead and close this issue.