Added arch_delete_many_aws4.sh

This commit is contained in:
2022-03-30 13:38:18 +09:00
parent 237f95873b
commit 4ac983de0d
2 changed files with 96 additions and 4 deletions

View File

@@ -6,10 +6,11 @@
# https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
#
# Usage
# arch_list_aws4.sh path/in/bucket/prefix_
# arch_list_aws4.sh [path/in/bucket/prefix_]
#
# Description
# Print a sorted list of object keys using path/in/bucket/prefix_
# Print a list of object keys using path/in/bucket/prefix_
# Defaults to print all keys within a bucket if no prefix is defined
# * maximum 1000 items, continuation-token is not implemented
# * modify _urlencode function to support more special characters
#
@@ -102,5 +103,4 @@ curl -s -XGET \
-H "Authorization: AWS4-HMAC-SHA256 Credential=$ACCESS_KEY/$_DATE/$REGION/$SERVICE/aws4_request, SignedHeaders=$_HEADERS, Signature=$SIG" \
"https://$BUCKET_URL/$_PATH?$QSTR" \
| grep -Eo "<Key>[^<]*?</Key>" \
| sed "s/^<Key>\|<\/Key>//g" \
| sort
| sed "s/^<Key>\|<\/Key>//g"