Created
January 11, 2023 08:03
-
-
Save regmicmahesh/4aabacc9766e15c1ce635b642a8a2790 to your computer and use it in GitHub Desktop.
sync aws across accounts
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 | |
function sync_aws() { | |
SRC_BUCKET=$1 | |
FOLDER_NAME=$2 | |
DEST_BUCKET=$3 | |
export DEFAULT_AWS_REGION=us-east-1 | |
export AWS_REGION=us-east-1 | |
export AWS_PROFILE=default | |
aws s3 sync s3://${SRC_BUCKET} ./${FOLDER_NAME} | |
export AWS_PROFILE=ml | |
aws s3 sync ./${FOLDER_NAME} s3://${DEST_BUCKET} | |
rm -rf ./${FOLDER_NAME} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment