Unix & Linux: Can rsync resume after being interrupted? (6 Solutions!!)
Channel: Roel Van de Paar
Date: 2020-08-08

Unix & Linux: Can rsync resume after being interrupted?


The Question: I used rsync to copy a large number of files, but my OS (Ubuntu) restarted
unexpectedly.
After reboot, I ran rsync again, but from the output on the terminal, I found
that rsync still copied those already copied before. But I heard that rsync is
able to find differences between source and destination, and therefore to just
copy the differences. So I wonder in my case if rsync can resume what was left
last time?

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 1 person ==
I think you are forcibly calling the rsync and hence all data is getting
downloaded when you recall it again. use --progress option to copy only those
files which are not copied and --delete option to delete any files if already
copied and now it does not exist in source folder...
rsync -avz --progress --delete -e /home/path/folder1/ /home/path/folder2
If you are using ssh to login to other system and copy the files,
rsync -avz --progress --delete -e "ssh -o UserKnownHostsFile=/dev/null -
o StrictHostKeyChecking=no" /home/path/folder1/ /home/path/folder2
let me know if there is any mistake in my understanding of this concept...

== This solution helped 40 people ==
You may want to add the -P option to your command.
From the man page:
 --partial By default, rsync 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.

 -P The -P option is equivalent to --partial --progress. Its
 pur-
 pose is to make it much easier to specify these two options for
 a long transfer that may be interrupted.
So instead of:
sudo rsync -azvv /home/path/folder1/ /home/path/folder2
Do:
sudo rsync -azvvP /home/path/folder1/ /home/path/folder2
Of course, if you don't want the progress updates, you can just use --partial,
i.e.:
sudo rsync --partial -azvv /home/path/folder1/ /home/path/folder2

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free-music | Images: https://stocksnap.io/license & others | With thanks to user Yadunandana (https://unix.stackexchange.com/users/17323), user Tim (https://unix.stackexchange.com/users/674), user NeverEndingQueue (https://unix.stackexchange.com/users/211197), user N2O (https://unix.stackexchange.com/users/79066), user lazysoundsystem (https://unix.stackexchange.com/users/4400), user gaoithe (https://unix.stackexchange.com/users/74372), user DarkHeart (https://unix.stackexchange.com/users/14755), user DanielSmedegaardBuus (https://unix.stackexchange.com/users/30193), user Anthon (https://unix.stackexchange.com/users/33055), user Alexander O'Mara (https://unix.stackexchange.com/users/149785), and the Stack Exchange Network (http://unix.stackexchange.com/questions/48298). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.