Fortschritt innerhalb einer Pipe verfolgen

Das habe ich gera­de zufäl­lig ent­deckt: pv. Ein net­tes Tool!

$ whatis pv
pv (1) - monitor the progress of data through a pipe
$

Neh­men wir mal dd, wo man sich nie sicher sein kann, wie weit es schon ist:

# dd if=/dev/zero bs=100M count=10 | ssh target 'dd of=/tmp/1G'
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB) copied, 97.2277 s, 10.8 MB/s
2048000+0 records in
2048000+0 records out
1048576000 bytes (1.0 GB) copied, 96.7274 s, 10.8 MB/s
#

funk­tio­niert, aber man hat wäh­rend des Kopie­rens kei­ner­lei Rück­mel­dung. Mit pv:

# dd if=/dev/zero bs=100M count=10 | pv -petrs 1000M | ssh target 'dd of=/tmp/1G'
10+0 records inB/s] [==========================================> ] 99% ETA 0:00:00
10+0 records out
1048576000 bytes (1.0 GB) copied, 98.3466 s, 10.7 MB/s
0:01:38 [10.2MiB/s] [==========================================>] 100%
2048000+0 records in
2048000+0 records out
1048576000 bytes (1.0 GB) copied, 97.8069 s, 10.7 MB/s
#

Nett, oder?
Die man­page hat noch viel schö­ne­re Beispiele.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert