-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Extract without full path #1102
Comments
from
|
In general: causing a desaster by badly mistyping |
Thank you for your answer, I read too quickly and didn't get the purpose of this option. I agree with what you said anyway, I always try to be as careful as possible. |
The commands and options here are rather unfriendly to the user... |
@jcrben so, what is your suggestion to improve? |
Sorry to be critical without more details! Why would an option for removing leading path elements be called I think also this sort of problem is better solved by specifying the path directly rather than trying to strip out elements with a number. It's like the difference between an array and a hash map: see https://www.reddit.com/r/programming/comments/lirke/simple_made_easy_by_rich_hickey_video/ |
So, what you suggest is --strip-path=/path/prefix/to/strip ? |
Maybe, but I guess I was thinking I'd just specify the full intended pathname explicitly as an override. I haven't run into this use case yet. I guess I'd also rather just use code to do something like this... I'm mostly using borg-backup in an automated fashion with scripts so I would probably just split the path and slice it as necessary if needed. |
@jcrben not sure i understand. assume you have these pathes in the archive: mnt/server/home/username/document.txt So, one likely will want So, what would you do? |
IMHO, it would be most intuitive to be able to append the extraction root path to the repo definition, and use ending slashes like rsync: borg extract archive::repo/mnt/server/ home/username/document.txt etc/passwd Extraction would work like this: cd ~/code/ or mkdir ~/code/my_project_restored |
I don't think we want to make the repo::archive parsing even more complex than it already is (in contrary: there is a ticket to make it simpler by splitting it up). |
I think what I want is basically just a destination path for extract: jborg/attic#195 Generally when I'm extracting it is to examine the backup first rather than just clobbering my existing files... I guess this might be handled by the attic todo list per #1563 Making it clear that extract is relative to the current directory https://borgbackup.readthedocs.io/en/stable/quickstart.html#a-step-by-step-example could probably save a lot of confusion. See #1885 |
Hi,
I would like to know if there is a way to extract an archive without getting the full path. I didn't find this answer in the "borg extract options".
If I am in /home/user, and want to extract the directory /home/toto/important_files from my backup, I will get the following path: /home/user/home/toto/important_files.
I find this dangerous, because a user might want to delete the home directory recursively : rm -rf ~/home/
If by mistake, It runs rm -rf /home, it's bad. It's even worse for other directories etc/, and so on.
Thank you!
The text was updated successfully, but these errors were encountered: