Use AWS CLI to Copy from S3 to EC2

Question:

I have zipped files in an S3 bucket that I need to bring back to my EC2 instance. In the past, I moved the documents to S3 with the following command:

To move files from January 2014 back to EC2, I have tried the following command:

My understanding is that this command excludes all files but then includes all files with the prefix ‘2014-01’. I have confirmed that this is how the files I want start. I have also tried only one forward slash before mainstorage and including fewer files.

I have followed these two links from Amazon:

Answer:

Figured it out. The key was to define the filepath in –include , i.e. –include ‘2014-1‘. Correct command:

Leave a Reply