X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/c8f28654eb0a554e59d14a2c2c12ffe39f900f72..8862af6d48b78cf6cf055dec506e02704dbf141c:/s3 diff --git a/s3 b/s3 index 9ca45f8..9601162 100755 --- a/s3 +++ b/s3 @@ -5,7 +5,8 @@ CURL=/home/mwolson_admin/bin/curl HMAC=$(dirname $0)/s3-hmac -ATTEMPTS=3 +ATTEMPTS=7 +ATTEMPT_WAIT=10 # print a message and bail die() { @@ -159,12 +160,14 @@ s3_curl() { headers[${#headers[@]}]="Date: ${date}" [[ ${md5} ]] && headers[${#headers[@]}]="Content-MD5: ${md5}" tries=0 - while test $tries -lt 3; do + while test $tries -lt $ATTEMPTS; do tries=$(expr $tries + 1) $CURL ${arg} "${inout}" ${stdopts} -K <(curl_headers "${headers[@]}") \ "http://s3.amazonaws.com${bucket}${remote}" ret=$? test $ret -eq 0 && break; + sleep $ATTEMPT_WAIT + echo "Retrying ..." done return $ret }