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

-n flag not working in combination with tar #27

Open
tnknepp opened this issue Sep 16, 2019 · 2 comments
Open

-n flag not working in combination with tar #27

tnknepp opened this issue Sep 16, 2019 · 2 comments

Comments

@tnknepp
Copy link

tnknepp commented Sep 16, 2019

First, I don't know if this is a lbzip2 problem, or a problem with tar. I posted this question on stack exchange (here). Here is the short description: tar allows you to specify the compression algorithm and pass flag/options to that algorithm. So, this should tar a directory and pass that on to lbzip2 for compression using two processors in verbose mode:

tar cf dst.tar.bz2 src --use-compress-program=lbzip2 -v -n 2

The verbose flag works, but lbzip always uses the max number of processors.

RHEL 7.6
lbzip2 2.5

@cslycord
Copy link

In the command tar cf dst.tar.bz2 src --use-compress-program=lbzip2 -v -n 2
the "-v -n 2" at the end are arguments passed to tar.

The verbose flag works because tar understands verbose.

@tansy
Copy link

tansy commented Oct 5, 2022

The verbose flag works because tar understands verbose.

It doesn't. You use it wrong way.
It should be

$ tar cf dst.tar.bz2 src --use-compress-program='lbzip2 -v -n 2'

If you want to pass arguments to the compressor you have to enclose it in quotes.
What you did was to pass 'lbzip2' as compressor, '-v -n 2' as tar arguments. And they were interpreted as options ( '-v -n' ) and '2' as file name.
I bet you got warning from tar:
tar: 2: Cannot stat: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants