Advanced parameters
AWS S3 also provides more filtering options when copying files from local to S3 or vice versa, i.e –include and –exclude arguments.
- –include (string) Don’t exclude files or objects in the command that match the specified pattern. See Use of Exclude and Include Filters for details.
- –exclude (string) Exclude all files or objects from the command that matches the specified pattern.
The pattern should contain the following expressions
- * Matches everything
- ? Matches any single character
- [sequence] Matches any character in sequence
- [!sequence] Matches any character not in sequence
The below example will copy all files in the current directory to s3 bucket except the files in the .git folder
aws s3 cp . s3://your-bucket-name/ --recursive --exclude ".git/*" --profile <myprofile>
AWS S3 CP Recursive
Amazon Web Services (AWS) is a comprehensive cloud computing platform offering many services, including storage, computing, databases, and more. Amazon S3 (Simple Storage Service) is a scalable object storage service from AWS. S3 provides a highly durable and cost-effective platform for storing various data types, including documents, images, videos, backups, and archives. S3 has different pricing models based on the frequency of accessing those objects. You can access your S3 data from anywhere with an internet connection, making it ideal for various cloud-based applications.