Fix inaccurate counter in restic-job script

This commit is contained in:
Ryan Cavicchioni 2020-10-10 10:54:25 -05:00
parent 838d9b00dd
commit 6a55359d28
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -111,10 +111,12 @@ until [ $counter -eq "$MAX_ATTEMPTS" ] || [ $rc -eq 0 ]; do
rc=$? rc=$?
if [ $rc -ne 0 ]; then if [ $rc -eq 0 ]; then
sleep=$((counter * 5)) break
printf "sleeping for %d seconds (%d)\n" $sleep $counter else
sleep $sleep sleep=$((counter * 5))
printf "sleeping for %d seconds (%d)\n" $sleep $counter
sleep $sleep
fi fi
(( counter++ )) (( counter++ ))