garethgeorge / backrest

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

Is there no way to simply restore a file? #436

Open QuarkZ26 opened 2 months ago

QuarkZ26 commented 2 months ago

Hello,

After backing up, when using the Restore to path option, I have to not only select an empty path, but it restores the whole path with subfolders.

Let's say I want to restore /home/user/Docs/stuff.pdf into /home/user/Docs, it's not possible, I would have to use a subfolder, and that subfolder will have the whole /subfolder/home/user/Docs/stuff.pdf folders, which doesn't really make much sense to me. I should be able to restore simply the file, to any location, and overwrite if needed.

Secondly, if you use root to backup, and restore the same way, /subfolder will be owned by root, which makes it quite annoying.

Is it possible to simply restore the file itself in Docs, with proper permissions or will have have to use Restic directly for that?

Thanks.

garethgeorge commented 2 months ago

Good point, looks like Backrest could be using the alternative restore syntax e.g. restic restore <snapshot ID>:<path> to avoid creating intermediate directories. I'll look at switching to switching over in the next minor version release.

garethgeorge commented 2 months ago

Implemented some of these changes in https://github.com/garethgeorge/backrest/commit/af09e47cdda921eb11cab970939740adb1612af4 , skipping windows for now.

QuarkZ26 commented 2 months ago

Even after update 1.5.0, it's still not restoring the way it should. Restoring a file still complains about the folder not being empty, and will only restore into a subfolder, which isn't ideal. Not only, but the subfolder is owned by root. Example, restoring file.pdf into Docs, will create file.pdf/file.pdf.

Any file or folder should be restoreable into whatever root folder chosen (Docs/file.pdf) and be owned by the user, and it should overwrite any file in the folder.