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

Restore path on Windows is wrong #528

Open
auanasgheps opened this issue Oct 22, 2024 · 2 comments
Open

Restore path on Windows is wrong #528

auanasgheps opened this issue Oct 22, 2024 · 2 comments
Labels
bug Something isn't working p2

Comments

@auanasgheps
Copy link

Describe the bug
Restore path on Windows is wrong, it kinda duplicates it.

Example:

I need to restore C:\Users\John\Desktop\Photos

I select the folder, then I choose the such path.
The restore happens is such folder, but in the folder "Photos" it has re-created all the structure from the root. There's a C folder, then a Users folder and so on.

To Reproduce
Steps to reproduce the behavior:

  1. Pick a folder to be restored
  2. Enter the correct path of the folder
  3. Observe that inside the destination folder the path is createt from the root.

Expected behavior
Restore the files as they are

Platform Info

  • Windows 10 22H2 x64
  • Backrest Version; 1.6.1
@auanasgheps auanasgheps added the bug Something isn't working label Oct 22, 2024
@auanasgheps auanasgheps changed the title Restore path on Windows wrong Restore path on Windows is wrong Oct 22, 2024
@garethgeorge garethgeorge added the p2 label Nov 5, 2024
@garethgeorge
Copy link
Owner

This does need fixing -- a targeted patch related to this was done for Linux, I need to implement and test something similar for Windows.

@garethgeorge
Copy link
Owner

Relevant lines of code are

if runtime.GOOS == "windows" {
opts = append(opts, restic.WithFlags("--include", snapshotPath))
} else {
dir := path.Dir(snapshotPath)
base := path.Base(snapshotPath)
if dir != "" {
snapshotId = snapshotId + ":" + dir
}
if base != "" {
opts = append(opts, restic.WithFlags("--include", base))
}
}
, which as you can see involve a bit of command crafting. Some work is needed to figure out whether the same or something similar works well on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

No branches or pull requests

2 participants