borgbackup / borgbackup/borg

borg import-tar / create / recreate: add --strip-components

Open
#6,461 13 comments 0 reactions 0 assignees View on GitHub
cmd: create cmd: recreate cmd: tar enhancement
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
11h 15m
Merged PRs (30d)
192

Description

Trying to use `borg import-tar`

[Docs](https://borgbackup.readthedocs.io/en/stable/usage/tar.html) say: _a `--tar-filter` program may be explicitly specified. It should read compressed data from **stdin** and output an uncompressed tar stream on **stdout**._

Can someone please show me how to do `tar -xzv --strip-components=1` as the filter program? I tried a few different ways but always just seems to hang..

`borg import-tar --tar-filter="tar -xzvf - --strip-components=1" /path/to/repo::archive-name /path/to/something.tar.gz`
`borg import-tar --tar-filter="tar -xzv --strip-components=1 -f -" /path/to/repo::archive-name /path/to/something.tar.gz`
etc..

Shouldn't `-f -` make tar read from stdin and output to stdout?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.