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
| aws s3 ls s3://mybucket/ --recursive | awk '{print $4}' | parallel 'echo {}; if [ "$(aws s3api head-object --bucket mybucket --output json --key {} | jq .ContentType -r)" = "binary/octet-stream" ]; then echo {} >> dodgy.txt; fi' | |
| cat dodgy.txt | grep png | parallel 'echo {}; aws s3 cp --content-type="image/png" --metadata-directive="REPLACE" s3://mybucket/{} s3://mybucket/{}' |