Created
May 27, 2021 17:47
-
-
Save dyno/2ecc84856e1887127e3d17ef7cdc0b17 to your computer and use it in GitHub Desktop.
aws s3 touch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://stackoverflow.com/questions/13455168/is-there-a-way-to-touch-a-file-in-amazon-s3 | |
aws_s3_touch() { | |
python3 -c 'from urllib.parse import urlparse; u=urlparse("'$1'"); print(f"{u.netloc} {u.path[1:]}")' | while read bucket key; | |
do | |
aws s3api put-object --bucket $bucket --key $key | |
done | |
} | |
aws_s3_touch s3://mybucket/path/to/file.success |
Author
dyno
commented
May 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment