Linux / Unix: Rsync Resume Partially Downloaded Files

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/
🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • Brian Jul 18, 2012 @ 23:56

    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.

  • youcef Jan 14, 2015 @ 11:14

    Thank you. it works great :)

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.