Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws s3 cp multiple files in one command

I am copying multiple files to s3 using one command

[ec2-user@ip-172-31-38-250 ~]$ ls *.rpm
1.rpm
2.rpm
3.rpm

how do I copy these 3 rpms in 1 aws cli command?

I tried

aws s3 cp *.rpm s3://mybucket1/rpms/

I got an error

Unknown options: 1.rpm, 2.rpm, 3.rpm,s3://mybucket1/rpms/
like image 581
bherto39 Avatar asked Oct 20 '25 17:10

bherto39


1 Answers

You can use filters:

aws s3 cp . s3://mybucket1/rpms/ --recursive --exclude "*" --include "*.rpm"

or with sync:

aws s3 sync . s3://mybucket1/rpms/ --exclude "*" --include "*.rpm"
like image 120
Marcin Avatar answered Oct 23 '25 07:10

Marcin