Download a custom file to the AWS S3 CLI

I have files in the S3 bucket, I tried to upload files based on the date, for example, August 08th, August 09th, how can I upload a custom date file ?. I used the following code, but it still loads the entire bucket list

aws s3 cp s3://bucketname/ folder/file --profile pname --exclude \"*\" --recursive --include \"" + "2015-08-09" + "*\" 

I am not sure how to achieve this.

+4
source share
1 answer

This command will copy all files starting from 2015-08-15 :

 aws s3 cp s3://BUCKET/ folder --exclude "*" --include "2015-08-15*" --recursive 

If your goal is to synchronize a set of files without copying them twice, use the sync command:

 aws s3 sync s3://BUCKET/ folder 

This will copy all files that have been added or changed since the previous synchronization.

This is actually equivalent to the cp command above:

 aws s3 sync s3://BUCKET/ folder --exclude "*" --include "2015-08-15*" 

Literature:

+16
source

All Articles