How to use Pigz with Tar How to use Pigz with Tar bash bash

How to use Pigz with Tar


Mark Adler's top voted answer on the SO link that you included in your question does provide a solution for specifying compression-level as well as number of processors to use:

tar cf - paths-to-archive | pigz -9 -p 32 > archive.tar.gz

See : https://stackoverflow.com/a/12320421


To pass arguments to pigz using -I or --use-compress-program, you can enclose the command and arguments in quotes, like so:

tar --use-compress-program="pigz --best --recursive" -cf archive.tar.gz YourData

Here's a fun option to monitor the speed of the archive creation:

tar --use-compress-program="pigz --best --recursive | pv" -cf archive.tar.gz YourData


fast unpack:

tar -I pigz -xf /mnt/sd/current/backup/bigbackup_web.tar.gz -C /tmp

fast pack:

tar -cf bigbackup.tar.gz -I pigz /opt

then:

apt-get install pigz

or

yum install pigz