I'm asking about a scenario of copying a big file to a remote server.
A simplest case is:
tar c myfile | ssh myserver tar x
If network connectivity is fast then all is fine.
On a slower network I do
tar c myfile | bzip2 -1 | ssh myserver tar xj
-- making my transfer faster at the cost of CPU time.
Of course I can play with compression ratio, typically trying to guess the right one so my CPU is not too busy and the network is saturated.
Is there a compression utility or a compression flag that would tell bzip2
/xz
/... to compress as much as possible while the output buffer is busy?
zstd 1.3.3
, which doesn't support the flag, but 1.4.0 I've built from sources does. Thank you. – bohdan_trotsenko Jun 07 '19 at 10:18-T0 --long
for the win. – Tom Hale Feb 21 '21 at 01:39