User Tools

Site Tools


rsync_loop_script

Loops rsync until exitcode is 0

#!/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
rsync_loop_script.txt · Last modified: 2018/05/08 12:58 by admin