Solved xz compression level

The following command

XZ_OPT=-9 tar -cvJf folder.tar.xz folder

Does not directly work on FreeBSD to compress a folder unless one is using a bash shell. Is there an equivalent way to compress a folder of files while also being able to set the compression level without piping output between programs? Parallel compression seems to be tricky to get going as well.
 
Well this seems to work well:

tar -cvf folder.tar folder; xz -9 folder.tar

Also with parallel xz:

tar -cvf folder.tar folder; pixz -9 folder.tar
 
Back
Top