User Tools

Site Tools


rsync_loop_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rsync_loop_script [2018/05/08 14:58] (current)
admin created
Line 1: Line 1:
 +**Loops rsync until exitcode is 0**
  
 +<​code>​
 +#!/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
 +</​code>​
rsync_loop_script.txt ยท Last modified: 2018/05/08 14:58 by admin