diff --git a/aws/aws_ec2_ebs_create_snapshot_and_wait.sh b/aws/aws_ec2_ebs_create_snapshot_and_wait.sh index 973635f3..3e484872 100755 --- a/aws/aws_ec2_ebs_create_snapshot_and_wait.sh +++ b/aws/aws_ec2_ebs_create_snapshot_and_wait.sh @@ -88,12 +88,7 @@ while : ; do timestamp "Snapshot still in pending state, waiting $sleep_secs secs before checking again" sleep "$sleep_secs" # exponential backoff - if [ "$sleep_secs" -lt "$MAX_WATCH_SLEEP_SECS" ]; then - sleep_secs="$((sleep_secs * 2))" - fi - if [ "$sleep_secs" -gt "$MAX_WATCH_SLEEP_SECS" ]; then - sleep_secs="$MAX_WATCH_SLEEP_SECS" - fi + sleep_secs="$(exponential "$sleep_secs" "$MAX_WATCH_SLEEP_SECS")" continue fi break