Restart rsync on failure

When copying a large site form a shared server using rsync, the rsync process on get killed, this may be done by some program on shared host or server admin manually killing the process.

Here is a bash script that will check if rsync exited normally or not, then retry the trasfter is rsync failure detected.

Save the file as, then run it with

You need to add servers SSH key in remote server so rsync work with out password.