0

I have these files in my source folder

source_path/date=20191230/somefile.txt
source_path/date=20191231/somefile.txt
source_path/date=20200101/somefile.txt
source_path/date=20200102/somefile.txt

If I do the bellow command all files will be copied to my dest_path folder

cp --recursive source_path/date=20200* dest_path/

It works perfectly in my local machine

I just get copy these files to my dest_path as i wanted

source_path/date=20200101/somefile.txt
source_path/date=20200102/somefile.txt

The problem comes when I replicate this same thing in aws. I am copying from S3 to my Ec2 instance with this comand

aws s3 cp --recursive s3://source_path/date=20200* home/ec2-user/dest_path/

This does not work nor gives a error it just gives this output

0.35user 0.05system 0:00.48elapsed 85%CPU (0avgtext+0avgdata 50660maxresident)k
0inputs+0outputs (0major+17977minor)pagefaults 0swaps
2
  • 1
    I think that this is not a question about the Unix&Linux shell and also I think you can get an answer from this post
    – thanasisp
    Oct 30, 2020 at 14:40
  • @ thanasisp Thankyou very much you just saved my weekend!!! This is exactly what I am looking for Oct 30, 2020 at 17:56

1 Answer 1

1

From punkrockpolly's answer on Stack Overflow (spotted by thanasisp):


To download multiple files from an aws bucket to your current directory, you can use recursive, exclude, and include flags. The order of the parameters matters.

Example command:

aws s3 cp s3://data/ . --recursive --exclude "*" --include "2016-08*"

For more info on how to use these filters: http://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .