Feature request: Support for borg --strip-components argument #324

Closed
opened 2020-06-06 15:13:00 +00:00 by claes · 8 comments

What I'm trying to do and why

I want to apply the borg --strip-components argument when extracting from borg archive, in order to remove the leading path arguments from the extracted files

This is useful when the backup has archived from the root but I want to extract a subdirectory to a specific location (but as a top-level-directory in that location)

See https://borgbackup.readthedocs.io/en/stable/usage/extract.html

#### What I'm trying to do and why I want to apply the borg --strip-components argument when extracting from borg archive, in order to remove the leading path arguments from the extracted files This is useful when the backup has archived from the root but I want to extract a subdirectory to a specific location (but as a top-level-directory in that location) See https://borgbackup.readthedocs.io/en/stable/usage/extract.html
Owner

Seems like a reasonable flag to add! I assume you're aware of the existing borgmatic extract --destination flag, but you still need/want --strip-components to further manipulate the extracted path?

Seems like a reasonable flag to add! I assume you're aware of the existing `borgmatic extract --destination` flag, but you still need/want `--strip-components` to further manipulate the extracted path?
claes closed this issue 2020-06-06 20:44:18 +00:00
Author

Yes I am aware of it and want to use them in combination.
For example, if the backup contains home/claes/.bashrc (because it is backed up from /), and I want to extract .bashrc into a specific directory, then I specify that directory with --destination, but I also want to supply --strip-components 2 so it does not extract it as home/claes/.bashrc, only as .bashrc.

I currently do this with borg directly but it would be good if I could do it with borgmatic as it packages all configuration around a backup and its keys etc so nicely.

Yes I am aware of it and want to use them in combination. For example, if the backup contains home/claes/.bashrc (because it is backed up from /), and I want to extract .bashrc into a specific directory, then I specify that directory with --destination, but I also want to supply --strip-components 2 so it does not extract it as home/claes/.bashrc, only as .bashrc. I currently do this with borg directly but it would be good if I could do it with borgmatic as it packages all configuration around a backup and its keys etc so nicely.
Owner

Makes sense! Thanks for the explanation.

Makes sense! Thanks for the explanation.
Author

Seems I closed it by mistake, I am reopening if it is ok

Seems I closed it by mistake, I am reopening if it is ok
claes reopened this issue 2020-06-06 21:10:32 +00:00
Owner

Yup, no worries!

Yup, no worries!
Owner

This is implemented now in master, and it'll be released shortly!

This is implemented now in master, and it'll be released shortly!
Owner

Okay, this is released in borgmatic 1.5.6. Thanks for the suggestion!

Okay, this is released in borgmatic 1.5.6. Thanks for the suggestion!
Author

Thanks a lot!!

Thanks a lot!!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#324
No description provided.