Linux / Unix: Rsync Resume Partially Downloaded Files

by on July 2, 2012 · 1 comment· LAST UPDATED July 2, 2012

in

I know wget command can resume downloads. H>ow do I resume partially transferred files using rsync command line under Unix like operating systems?

Yee, by default, the rsync command will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster. The syntax is:

 
rsync -av --partial /path/to/file /path/to/dest
rsync -av --partial user@server1.cyberciti.biz:/path/to/file /path/to/dest
 

You can also use -P option for the same purpose. In this example, copy partially transferred file:

 
rsync -avP user@server1.cyberciti.biz:~/Downloads/centos.iso ~/Downloads/
 
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 Brian July 18, 2012 at 11:56 pm

One thing to note is that when using –partial, rsync will save the partial file with the final name of the file, but it will be truncated. The next time you run the rsync, that file will NOT appear to be getting updated. Rsync will make a copy of it with a temp file name that starts with a “.”. You can see the file by using “ls -a” in the same directory as your file. It will perform a checksum of each part of the local file and copy that chunk to the new file, then it will start getting the missing chunks from the remote server.

This can be very confusing from an interface standpoint, since you will not see the original partial file get updated until the transfer is complete. You will also see the speed (if using –progress) appear to go really fast, but this is cause by the local file copy, not a sudden huge increase in your network bandwidth.

Summary: using –partial is very helpful, but the feedback it provides can be confusing.

Reply

Leave a Comment

Tagged as: , , , , , , , , , ,

Previous Faq:

Next Faq: