3
votes

I'm copying between s3 buckets files from specific dates that are not sequence. In the example I'm copying from the 23, so I'd like to copy 15th, 19, and 23rd.

aws s3 --region eu-central-1 --profile LOCALPROFILE cp s3://SRC s3://DEST --recursive --exclude "*" --include "2016-01-23"

This source mentions using sequences http://docs.aws.amazon.com/cli/latest/reference/s3/ for include.

1
What exactly is your question? Is it what you've asked in the title -- that is, how to specify multiple include conditions?John Rotenstein
Yes, how to use include to copy from files with 23 OR 15 OR 19. That is is to say copy 2016-01-19 and 2016-23 and 2016-01-15 but not 2016-01-20, 2016-01-21, 2016-01-17OrigamiEye

1 Answers

7
votes

It appears that you are asking how to copy multiple files/paths in one command.

The AWS Command-Line Interface (CLI) allows multiple --include specifications, eg:

aws s3 cp s3://SRC s3://DEST --recursive --exclude "*" --include "2016-01-15/*" --include "2016-01-19/*" --include "2016-01-23/*"

The first --exclude says to exclude all files, then the subsequent --include parameters add paths to be included in the copy.

See: Use of Exclude and Include Filters in the documentation.