Is there any handy way to follow multiple piped commands' status output
2
votes
1
answer
117
views
Let's say I have serverA with a block device, the contents of which I want to move to serverB's block device via the computer I am working on as a relay. This is very handy with pipes, buffers, dd and similar tools.
In order to monitor the progress and identify any bottlenecks, I like to follow the progress of the individual status output of each command.
Aside from complicating this one-liner by running multiple terminals, backgrounding (&), looping the outputs through FIFOs or the like, is there any way to handily sort the status outputs?
ssh serverA "sudo dd if=/dev/sdc status=progress | mbuffer" | mbuffer | ssh serverB "mbuffer | sudo dd of=/dev/sdc status=progress"
This gives me a single row that rapidly switches between the five different commands' status and also does not clean the row in between. For example alternating between the following (note the '00% full' on the alternate output):
in @ 6137 kiB/s, out @ 6137 kiB/s, 26.3 GiB total, buffer 100% full
30353129472 bytes (30 GB, 28 GiB) copied, 1158 s, 26.2 MB/s00% full
A neat output would keep each command's output consistently on a separate row.
Asked by Johan Ehnberg
(119 rep)
Feb 22, 2022, 04:28 PM
Last activity: Oct 5, 2024, 02:35 PM
Last activity: Oct 5, 2024, 02:35 PM