Intellipaat Back

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

How to exclude multiple folders while using aws s3 syn?

I tried :

# aws s3 sync  s3://inksedge-app-file-storage-bucket-prod-env   s3://inksedge-app-file-storage-bucket-test-env --exclude 'reportTemplate/* orders/* customers/*'

But still, it's doing sync for folder "customer"

Output :

copy: s3://inksedge-app-file-storage-bucket-prod-env/customers/116/miniimages/IMG_4800.jpg to s3://inksedge-app-file-storage-bucket-test-env/customers/116/miniimages/IMG_4800.jpg

copy: s3://inksedge-app-file-storage-bucket-prod-env/customers/116/miniimages/DSC_0358.JPG to s3://inksedge-app-file-storage-bucket-test-env/customers/116/miniimages/DSC_0358.JPG

1 Answer

0 votes
by (44.4k points)
edited by

This will work:

sudo  aws s3 sync  s3://xxxx-app-file-storage-bucket-prod-env   s3://xxxx-app-file-storage-bucket-test-env --exclude 'customers/*'  --exclude 'orders/*' --exclude 'reportTemplate/*'  

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in the sequence

[!sequence]: Matches any character not in sequence

Need help mastering AWS Lambda and other AWS skills? Go through AWS Training Page and become an AWS expert!

Related questions

Want to get 50% Hike on your Salary?

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

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...