I have the following directory in my local computer:
dir1
|
|__ randomfile.jpg
|__ dir2
|
|__ file1.txt
|__ file2.txt
|__ pict.png
What I want to do is to copy all the files with *.txt
and preserving the subdirectory structure to Amazon S3 bucket. How can I do that?
At the end of the day in S3. We'd like to find this file and directory structure:
dir1
|
|__ dir2
|
|__ file1.txt
|__ file2.txt
With standard Unix command I can do this:
find . -name '*.txt' -exec cp --parents \{\} /target \;
But not sure how to do with with AWS command line.
In reality with have files with ~10Tb of size to transfer.
Just use sync:
aws s3 sync src/ s3://mybucket --exclude "*" --include "*.txt"
Exclude include doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With