3 ms·
The original posts were about progress indication on the file transfers, so I would add an invocation of pv in your example: tar -zc /somedir/ | pv | ssh r
by dspillett 11y ago
The original posts were about progress indication on the file transfers, so I would add an invocation of pv in your example:
tar -zc /somedir/ | pv | ssh remotebox tar -xzC /somedir/
That won't give a % done as it won't know the total size, but if you scan the source first and split out the tar and compress stages you can achieve that though it'll be a little less efficient:
tar -c somedir | pv --size `du somedir -bs | cut -f1` | ssh -C remotebox tar -xC /tmp/
and if you want to keep the compression via gzip instead of ssh (I'm not sure that'll make any difference myself as ssh IIRC uses the same algorithm, though I've not benchmarked it at all):
tar -c somedir | pv --size `du somedir -bs | cut -f1` | gzip | ssh remotebox tar -xzC /somedir/