Last Updated: February 25, 2016
·
4.552K
· datasaur

Monitor zfs send and receive (with parallel compression)

Use pipe viewer to monitor progress of a zfs send operation. Parallelizing compression via pigz can significantly reduce run time:

zfs send $1 | pv -c -s $(zfs send -RnP $1 2>&1 | awk '{if ($1 == "size") {print $2}}') | pigz -c > $2.zfs.gz

pv $1 | unpigz -c | zfs receive $2

2 Responses
Add your response

Can we get a little more detail on what this script is doing ? the $1 variable are part of a different input with the ZFS snapshot ?

over 1 year ago ·

If put in a shell script, $1 is the name of the ZFS snapshot to send, and $2 is the name of the filename the compressed snapshot is stored in (the first and second args passed to the script).

over 1 year ago ·