Quickest network copy on Linux

Today we don’t have any time.

Here a fun way to copy data throught network on two Linux servers at maximum speed

You will just need to install

apt install -y netcat

Assuming 192.168.1.2 is reciever ip

  • On Reciever :
netcat -l -p 9000 | tar xv
  • On Sender:
tar -cf - folder-data | netcat 192.168.1.2 9000
# if you want speed detail
tar -cf - folder-data | pv | netcat 192.168.1.36 9000

Check with iotop

root@coffee:/home/tom# iotop -o -b
Current DISK READ:       3.82 K/s | Current DISK WRITE:     270.08 M/s
    TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
    698 be/4 root        3.82 K/s    0.00 B/s  0.00 % 75.88 % [txg_sync]
     24 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/2:0-events_freezable_power_]
     29 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/3:0-events_freezable_power_]
     14 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:1-events]
    834 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/3:3-events_freezable_power_]
   1096 be/4 root        0.00 B/s  108.07 M/s  0.00 %  0.00 % tar xv

Keep in mind, this technic is not secured ( traffic is not encrypted ) and does not guarantee data integrity.