Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm trying to upload all files of type .flv to an S3 bucket using the AWS CLI from a Windows server 2008 command line.

I do this:

aws s3 sync . s3://MyBucket --exclude '*.png'

And it begins uploading .png files instead.

I'm trying to follow the documentation and it gives an example that reads:

The local directory contains 3 files:

MyFile1.txt

MyFile2.rtf

MyFile88.txt

'''

aws s3 sync . s3://MyBucket/MyFolder --exclude '*.txt'

upload: MyFile2.rtf to s3://MyBucket/MyFolder/MyFile2.rtf

So what am I doing wrong?

1 Answer

0 votes
by (44.4k points)

Use:

aws s3 sync . s3://MyBucket/ --exclude '*' --include "*.flv"

It excludes all files, then includes .flv files. The order of parameters is important.

You can also use:

aws s3 cp . s3://MyBucket/ --recursive --exclude "*" --include "*.flv"

The difference is that sync will not re-copy a file that already exists in the destination.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
asked Feb 7, 2020 in AWS by yuvraj (19.1k points)
+1 vote
1 answer
0 votes
1 answer

Browse Categories

...