#!/bin/bash
retry_count=5
retry_interval_seconds=10
count=1
while :
do
command
status=$?
if [ ${status} -eq 0 ]; then
exit 0
fi
if [ ${count} -eq ${retry_count} ]; then
break
fi
sleep_seconds=$((count * retry_interval_seconds))
count=$((count + 1))
echo Retry after ${sleep_seconds} seconds, next count is ${count}
sleep ${sleep_seconds}
done
echo Retry over
exit 1
厳密なExponential Backoffではない