From: Zoltán Felleg Date: Wed, 25 Sep 2024 10:23:51 +0000 (+0200) Subject: Updated scripts/rsyncbackup.sh (to retry if unsuccessful). X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=3c3820bcae9ba5506ba894835c7fae5f13e18588;p=user-lxc.git Updated scripts/rsyncbackup.sh (to retry if unsuccessful). --- diff --git a/scripts/rsyncbackup.sh b/scripts/rsyncbackup.sh index 97d105e..4b43001 100755 --- a/scripts/rsyncbackup.sh +++ b/scripts/rsyncbackup.sh @@ -27,6 +27,18 @@ TARGETHOST=store.10g.useribm.hu TARGETMODULE=backup echo "Syncing module lxc-filesystems to $TARGETHOST" date -$RSYNC /lxc/filesystems/ ${TARGETHOST}::$TARGETMODULE/lxc-filesystems +$RSYNC /lxc/filesystems/ ${TARGETHOST}::$TARGETMODULE/chost-lxc-filesystems +RSYNC_RC=$? +TRIES=1 +while [ $RSYNC_RC -ne 0 ] +do + if [ $TRIES -ge 10 ] + then + exit 1 + fi + $RSYNC /lxc/filesystems/ ${TARGETHOST}::$TARGETMODULE/chost-lxc-filesystems + RSYNC_RC=$? + TRIES=$(( $TRIES + 1 )) +done date echo