Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive restore feature #1168

Open
armhold opened this issue Aug 18, 2017 · 14 comments
Open

interactive restore feature #1168

armhold opened this issue Aug 18, 2017 · 14 comments
Labels
category: user interface help: wanted state: need direction need key decisions or input from core developers type: feature suggestion suggesting a new feature

Comments

@armhold
Copy link
Contributor

armhold commented Aug 18, 2017

Have you considered implementing an interactive restore feature?

For those old enough to remember, the old fashioned Unix dump/restore tools supported a shell-like restore, where one could interactively navigate the archive viacd, ls, etc.

The user could select files/dirs with add, and then finally restore them with extract.

I realize that restic mount provides part of this functionality already, but it would be nice to have it without requiring FUSE. I have a proof-of-concept at https://github.com/armhold/restic/blob/interactive/cmd/restic/cmd_interact.go

Curious to get your thoughts on this potential feature, thanks.

@flamingm0e
Copy link

I think an ncurses based interface for restore would be good.

@armhold
Copy link
Contributor Author

armhold commented Aug 25, 2017

ncurses (or maybe termio?) is an interesting idea, but I had something far simpler in mind.

I found that I was able to implement simple shell-like navigation just using the already existing deps. Mostly I just needed raw mode (for tab completion) and a simple readline(), both of which ssh/terminal provides.

Here's a recording of how it works so far:

https://asciinema.org/a/l5TqUNCgLgTap38gIKLLV1ZaY

@flamingm0e
Copy link

personally, I want to be able to go down a tree structure of some sort and select (space bar?) the files I want restored. manually typing in the filenames will become tedious, even with auto complete

@fd0
Copy link
Member

fd0 commented Aug 26, 2017

Hm, nice idea! I don't have time to look at it right now though, I'll probably do that later. Thanks for reporting the idea!

I'm aware that the restore command is a bit awkward to use if you don't want a full restore though.

@fd0 fd0 added type: feature suggestion suggesting a new feature help: wanted labels Aug 26, 2017
@rawtaz
Copy link
Contributor

rawtaz commented Sep 5, 2017

@armhold Not to dismiss your idea or feedback, but can you elaborate on why the current solution isn't a good fit for what you need?

I mean, there's FUSE which is designed to be used for mounting various types of filesystems/backends/whatever, a perfect match for a snapshot in your restic repository.

By utilizing it and mounting your snapshot, you can use any user interface you want, to browse the files in it. I don't really see what the point is to implement some kind of specific user interface in restic - that will give you one such interface, when as I said you already have the choice of many other ones.

Specifically, navigation using cd, ls, etc, is already doable. Selecting some of the files/folders that you then restore is also doable, via whatever user interface you want - indeed you might not have the add you mentioned, but you can simulate that in many ways, e.g. by adding files/folders to an environment variable or some file, as you navigate around in your FUSE mounted snapshot.

Is the thing that you don't want to use/install FUSE? Just trying to understand.

@armhold
Copy link
Contributor Author

armhold commented Sep 6, 2017

Hi @rawtaz.

I have nothing specifically against FUSE. To me, requiring the user to install a kernel extension is quite the opposite of Go's philosophy of "everything in a single static binary".

I'm on macOS, and when I see that a kernel extension is required, here is what goes through my mind: will it destabilize my OS? Will it write files in weird places on my system? Will I be able to un-install it easily? Will it cause problems when the next version of macOS comes out and I have this thing installed (that I have perhaps forgotten about)?

Again, nothing in particular against the FUSE project. For those willing to install it, I think it's is a fine solution. And no amount of code will beat a live mounted filesystem as FUSE provides.

But it seemed like it ought to be possible to provide a minimal interactive tool right inside of restic. I tried, and ~600 lines later I had something that worked well enough for my needs.

I do understand the need to keep codebases small & prevent feature-creep, so if you feel this is a narrow use-case, please feel free to close the issue.

Thanks!

@rawtaz
Copy link
Contributor

rawtaz commented Sep 6, 2017

@armhold Thanks, that clarified it a lot, I see where you're coming from.

Let me be very clear on one thing; I am not an official person of this project, I'm just a user like anyone else. So I would never dream of closing this ticket, that's entirely not my say :)

I think you have a point in that if there's a somewhat more flexible/interactive restore option, at a low cost in terms of the code quality, then why not! And since you're the one who brought it up and know how you envision it, your code might be a good starting point.

Thanks for clarifying.

@rawtaz
Copy link
Contributor

rawtaz commented Mar 15, 2018

Upon a second look at this I like it quite a lot 👍

@armhold Is it something you are using? Is it something you're intending to continue working on?

@armhold
Copy link
Contributor Author

armhold commented Mar 16, 2018

@rawtaz I was using it in a private branch for a while, but since there seemed to be no interest beyond me I haven't pursued it. I'm trying to be sensitive to feature bloat and maintainer overload. 😄

But if there really is a quorum of interest I'd be happy to pick it up again. I consider the cmd_interact.go above as a PoC or perhaps a starting point for such a feature.

@rawtaz
Copy link
Contributor

rawtaz commented Jul 28, 2018

@armhold Is the code available anywhere?

@armhold
Copy link
Contributor Author

armhold commented Jul 28, 2018

Hi @rawtaz, it's linked in the first comment of this issue (I mistakenly said "private branch" a couple comments ago, but I believe you should be able to access my fork; please let me know if that's not the case).

@rawtaz
Copy link
Contributor

rawtaz commented Jul 29, 2018

I'm an idiot.

@jtagcat
Copy link
Contributor

jtagcat commented Sep 21, 2019

Chronologically switching between backups would be great for finding an item.
I'd think ncdu-style browsing would be great - replace delete function with restore. Symmetrical/syncronized browsing with directory comparison could be also great (specify local directory or a backup and as argument 2 a backup (none=latest). (see FileZilla for what I mean) Chronological order backup switching for the 2nd can also work there.

@rawtaz
Copy link
Contributor

rawtaz commented Nov 19, 2019

@armhold I'm thinking this command should be named browse. It would complement restore which does a direct restore of files, and mount which mounts the repo in the filesystem using FUSE. Browse seems like a more natural name for what you would do with this feature, rather than interact.

Would you still be interested in polishing the code and making a PR out of it? If so, perhaps we can get @fd0's opinion on whether to pursue this or not. It would be a cool and useful addition I think, so one doesn't have to install FUSE.

@rawtaz rawtaz added the state: need feedback waiting for feedback, e.g. from the submitter label Nov 19, 2019
@MichaelEischer MichaelEischer added category: user interface state: need direction need key decisions or input from core developers and removed state: need feedback waiting for feedback, e.g. from the submitter labels Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: user interface help: wanted state: need direction need key decisions or input from core developers type: feature suggestion suggesting a new feature
Projects
None yet
Development

No branches or pull requests

6 participants