Some time ago I’ve been moving from one hosting provider to another. I had to transfer the files from A to B and used rsync for that. But unfortunately rsync command was crashing due to some timeouts. So I’ve found really nice script for auto restore.
#!/bin/bash while [ 1 ] do /usr/bin/rsync -avz --progress $1 $2 if [ "$?" = "0" ] ; then echo "rsync completed normally" exit else echo "Rsync failure. Backing off and retrying..." sleep 10 fi done
rsync-auto.sh SOURCE DESTINATION