diff --git a/assets/index-D2O8c59g.js b/assets/index-BveI0Wpb.js similarity index 99% rename from assets/index-D2O8c59g.js rename to assets/index-BveI0Wpb.js index 65062f3..a34a331 100644 --- a/assets/index-D2O8c59g.js +++ b/assets/index-BveI0Wpb.js @@ -420,8 +420,13 @@ function do_backup() { local create_bucket=$(echo $S3_CONFIG | jq -r '.createBucket') if [[ $create_bucket == "true" ]]; then - log "Create bucket: $bucket_name" - aws s3api create-bucket --bucket $bucket_name --endpoint-url $endpoint_url + local exists=$(aws s3api head-bucket --bucket $bucket_name --endpoint-url $endpoint_url 2>&1 || true) + if [[ $exists == "" ]]; then + log "Bucket $bucket_name already exists, so skip create" + else + log "Create bucket: $bucket_name" + aws s3api create-bucket --bucket $bucket_name --endpoint-url $endpoint_url + fi fi local count=$(echo $BACKUP_FILES | jq -r ".\${OPTION_POLICY} | length") diff --git a/backup.sh b/backup.sh index 3cdafc2..ff4df66 100644 --- a/backup.sh +++ b/backup.sh @@ -135,8 +135,13 @@ function do_backup() { local create_bucket=$(echo $S3_CONFIG | jq -r '.createBucket') if [[ $create_bucket == "true" ]]; then - log "Create bucket: $bucket_name" - aws s3api create-bucket --bucket $bucket_name --endpoint-url $endpoint_url + local exists=$(aws s3api head-bucket --bucket $bucket_name --endpoint-url $endpoint_url 2>&1 || true) + if [[ $exists == "" ]]; then + log "Bucket $bucket_name already exists, so skip create" + else + log "Create bucket: $bucket_name" + aws s3api create-bucket --bucket $bucket_name --endpoint-url $endpoint_url + fi fi local count=$(echo $BACKUP_FILES | jq -r ".${OPTION_POLICY} | length") diff --git a/index.html b/index.html index 96f2222..b0af272 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Zuke - +