How to use 7z to compress via pipe?
This is covered in the man page of 7z:
-si Read data from StdIn (eg: tar cf - directory | 7z a -si directory.tar.7z)
Is there a reason you want to use 7z
specifically, or do you just want better compression than gzip
?
The xz
utility uses the same compression algorithm as 7z
(LZMA), and allows piped compression the same as gzip
.
tar cvf ... | xz -9 | openssl ...