Merge branch 'master' of https://gitea.austenwares.com/stonewareslord/borg-remote-android
This commit is contained in:
commit
d96bab1ebf
@ -28,7 +28,19 @@ function time_diff {
|
||||
function backup() {
|
||||
# First, we need to rsync our changes to the host
|
||||
echo "Running rsync..."
|
||||
$RSYNC_COMMAND "$SOURCE_LOCATION" "$REMOTE_HOST:$DESTINATION_LOCATION" || return 1
|
||||
local RETRIES=10
|
||||
while (( RETRIES > 0 )); do
|
||||
# Try to rsync
|
||||
$RSYNC_COMMAND "$SOURCE_LOCATION" "$REMOTE_HOST:$DESTINATION_LOCATION" && break
|
||||
(( RETRIES-- ))
|
||||
echo "rsync failed. Retrying $RETRIES more times. Sleeping 10s"
|
||||
sleep 10s
|
||||
done
|
||||
|
||||
if (( RETRIES == 0 )); then
|
||||
# We exceeded the retry limit. Fail
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Next, instruct the host to create a borg
|
||||
echo "Running borg..."
|
||||
|
Loading…
Reference in New Issue
Block a user