Skip to content

Instantly share code, notes, and snippets.

@kiyanwang
Last active December 22, 2015 15:28
Show Gist options
  • Save kiyanwang/6492329 to your computer and use it in GitHub Desktop.
Save kiyanwang/6492329 to your computer and use it in GitHub Desktop.
Copy all files from a S3 bucket/folder to another S3 bucket/folder
s3cmd ls s3://sourcebucket/sourcefolder/ | awk '{ print $4 }' | tail -n +2 | sed -e 's!^s3://sourcebucket/sourcefolder/\([a-z0-9\_\.]*\)!s3cmd cp s3://sourcebucket/sourcefolder/\1 s3://targetbucket/targetfolder/\1!g' | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment