replace bzip2 with pbzip2

Hi,

I've noticed bzip2 does not scale (on Quad Core I have less than 1.0 load when archiving a big file with bzip2).

With pbzip2 I can speed up the archiving process x3 times.

Is ok to move bzip2 from /usr/bin/bzip2 and then create a symlink to pbzip2 ?

That would be something like this:
Code:
mv /usr/bin/bzip2 /usr/bin/bzip2.old
ln -s /usr/local/bin/pbzip2 /usr/bin/bzip2

I want that my tar utility to use bpzip2 instead of bzip2. I want to know if I break anything by using that method or if is there other approach other than the one with pipes.

The one with pipes would be:
Code:
tar cf - . | pbzip2 > ../file.tbz

or:

Code:
tar --use-compress-prog=pbzip2 -cf file.tbz .
 
In your first example I don't see why you would need the symlink nor in the second case.

Why don't you just leave bzip2 in place, thus reducing the chances of getting other weird behaviour, and just drop in pbzip2 as an argument where you need it?
 
I want to use:

Code:
tar -cvjf archive.tgz *

That's why I would need a symlink.

Well, I think I'll leave it as it is and use one of my examples from previous pos, until I am sure that I don't break anything.
 
overmind said:
I want to use:

Code:
tar -cvjf archive.tgz *

That's why I would need a symlink.

Well, I think I'll leave it as it is and use one of my examples from previous pos, until I am sure that I don't break anything.
Except that the compression algo for gzip and bzip2 is built into the tar binary. In your example, your proposed changes will have zero impact.
 
overmind said:
I want that my tar utility to use bpzip2 instead of bzip2. I want to know if I break anything by using that method or if is there other approach other than the one with pipes.

The one with pipes would be:
Code:
tar cf - . | pbzip2 > ../file.tbz

or:

Code:
tar --use-compress-prog=pbzip2 -cf file.tbz .
You can make shell alias for tar so he will alway use your prog:
Code:
alias tar tar --use-compress-prog=pbzip2
 
Back
Top