LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[programming][shell] How to copy files over a network with common commands #454

Open LukeShortCloud opened 3 years ago

LukeShortCloud commented 3 years ago

Common commands such as scp, rsync, netcat, etc.

LukeShortCloud commented 3 years ago

netcat example with zstd doing compression from stdin:

Receiver (start this process first):

# nc -l -p 3333 | zstd -f | dd bs=1M of=/root/backup.img.zst

Sender (redirect stderr to avoid dd report at the end that is not part of the backup itself):

# dd bs=1M if=/dev/sda 2> /dev/null | nc <RECIEVER_IP> 3333