Does rsync auto-resume after failed connections?
This Google search:
https://www.google.co.uk/search?q=rsync+auto-restart+failed+...
returns this link:
http://superuser.com/questions/302842/resume-rsync-over-ssh-...
which contains this script:
#!/bin/bash
while [ 1 ]
do
rsync -avz --partial source dest
if [ "$?" = "0" ] ; then
echo "rsync completed normally"
exit
else
echo "Rsync failure. Backing off and retrying..."
sleep 180
fi
done
The comment says: When the connection dies, rsync will quit
with a non-zero exit code. This script simply
keeps re-running rsync, letting it continue
until the synchronisation completes normally.
That's pretty much what I've done.Easier, faster, and more flexible just to write the script. It's what I do.
--partial keep partially transferred files
--append append data onto shorter filesFor automated transfers ("retry until done"), I use the lsyncd wrapper (which also watches the source files, so you don't need to poll for changes: it wakes up by inotify).
--partial keep partially transferred filesIn other words, this feature is a prerequisite for auto-resume, not auto-resume itself (which can be scripted in ~10 lines, as shown in a sibling thread).
--append append data onto shorter files
to resume interrupted transfers.