msgbartop
MAC OS X, Linux, Windows and other IT Tips and Tricks
msgbarbottom

03 Apr 15 Resuming files copy after break with rsync

In my work, I often need to transfer large files from my MAC desktop to a Linux server in Internet.
Since the Internet connection is often broken and changes IP, transferring of large files really can be difficult.
That is where rsync come to the rescue by saving the already transferred part of the file in a temporary location in the remote server. If the connection breaks the transfer can than be resumed by initiating the same command again.
Here is an example:
rsync --append --progress --partial -azvv /local/dir/ user@remote.srv:/data/backups/
This command will show you the progress of the recursive transfer of all files contained in /local/dir/ to the remote server in the existing directory /data/backups/. If the connection breaks, issuing the same command again will resume the transfer from where it got interrupted.

NOTE 1: Remember that pressing ‘CTRL-C’ to interrupt the transfer will defeat this resume feature since the remote server will detect that the transfer was intentionally interrupted by the user with CTRL-C and will delete the already transferred part of the current file. All fully transferred files will not be touched. Only the partially transferred part will be deleted.

NOTE 2: When resuming a broken transfer, the partially transferred file will get read in the remote server to verify where it should resume from. If the file is big that can take a while. Nevertheless it does that much much faster than re-transferring the whole file again.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: