dd & nc does not terminate

287 Views Asked by At

I try to backup a partition over the network to another client using dd and nc but after writing all data (output implies this), nc does not terminate. Because of this, the listening nc on the remote side does not terminate either. For manual backups the problem isn't that hard when it comes to automating the process I am running into problems.

/dev # dd if=/dev/XXXX | nc HOST PORT
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 4.134436 seconds, 3.9MB/s
[no promt]

When I try to write the output to /dev/null the command terminates after some seconds perfectly.

/dev # dd if=/dev/XXXX of=/dev/null
32768+0 records in
32768+0 records out
16777216 bytes (16.0MB) copied, 1.303730 seconds, 12.3MB/s
/dev #

As an alternative approach, I could use ssh instead of nc (explained here), ssh terminates but now I have the drawback to entering my password manually each time I want to schedule a backup. Additionally: I have no chance to modify the host (sending device) OS because its an embedded device with read-only mounted partitions & squashfs.

The sending device uses BusyBox v1.20.2

0

There are 0 best solutions below