Transfer files using SCP and RSYNC for transfer resume
For transfering files from a UNIX machine to another UNIX machine I use the SCP command. It goes like this:
scp yourFile user@remoteMachine:any/path/on/remote/machine/
This helps me alot when I’m transfering large files and I don’t want to do it from my laptop because I’m forced to wait until the transfer ends. So I just initiate the transfer from my local server that is running LINUX.
If the internet connection failes and the file transfer is broken I use RSYNC command to resume the transfer from the point where the connection failed. Here is an example of how to use RSYNC for that:
rsync –partial –progress –rsh=ssh yourFile user@remoteMachine:any/path/on/remote/machine/
Now let me qickly explain the parametters used:
–partial : keep partially transferred files. This allows us to resume the transfer.
–progress: show progress during transfer. This is prety self explanatory, you can use it only if you want.
–rsh=ssh: This is for tunneling RSYNK through SSH to have a secure communication between the 2 machines.
That’s it!