Created
October 28, 2022 05:25
-
-
Save Izzur/0f80909db0b941b1a8bb02dd57647dc4 to your computer and use it in GitHub Desktop.
Replace space with underscore and backup to s3 with md5 as filename
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 | |
for f in *; do | |
mv "$f" `echo $f | tr ' ' '_'`; | |
done | |
for f in *; do | |
echo $f; | |
echo $f | md5sum | awk '{print $1}'; | |
aws s3 cp $f s3://bucket-name-something/$(echo $f | md5sum | awk '{print $1}'); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment