Created
February 15, 2017 02:33
-
-
Save sneak/00c4c758a8b953caf834042c81f9ff5f to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
DESTPREFIX="papertrail/logs/12345" | |
BUCKET="org-global-papertrail-archive" | |
for FN in $(cat dailies.txt); do | |
ORIGPATH="old/$FN" | |
NEWDT=$(echo $FN | awk -F- '{print $1 "-" $2 "-" $3}') | |
NEWDT=$(echo $NEWDT | awk -F. '{print $1}') | |
NEWPATH="$DESTPREFIX/dt=$NEWDT/$FN" | |
echo aws s3 mv s3://$BUCKET/$ORIGPATH s3://$BUCKET/$NEWPATH | |
done | |
This file contains 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
#!/bin/bash | |
DESTPREFIX="papertrail/logs/12345" | |
BUCKET="org-global-papertrail-archive" | |
for FN in $(cat hourlies.txt); do | |
ORIGPATH="old/$FN" | |
NEWDT=$(echo $FN | awk -F- '{print $1 "-" $2 "-" $3}') | |
NEWPATH="$DESTPREFIX/dt=$NEWDT/$FN" | |
echo aws s3 mv s3://$BUCKET/$ORIGPATH s3://$BUCKET/$NEWPATH | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment