Transfer large files over a network
Rsync method
rsync -avzh --progress /path/to/source destination-ip:/path/on/dest
a
- "Archive mode" which equals -rlptgoD
.
v
- Verbose.
z
- Compress data being sent.
h
- Human readable format.
Netcat method
Netcat
is a simple UNIX utility that reads and writes data across network connections using TCP or UDP protocol. Tar
is a command-line archiving tool, and Pv
stands for pipe viewer, which is used to monitor the progress of data.
NOTE: All the commands need to be run at root.
Required packages: netcat, tar, and pv.
On the receiving node, run the following command:
netcat -l -p 7000 | pv | tar x
On the sending node, run the following command:
tar cf - * | pv | netcat 192.168.1.105 7000
Here 192.168.1.105
is the internal ip address of the destination system.
tar cf - *
will compress everything in the current working directory as a copy and the files will be extracted at the other end.