Reputation: 139
I have module where I need transfer all zip files from s3 bucket to my network computers by by just connecting each ip address \xx.xx.xx.xxx. right now im using laravel.
exec('aws s3 cp s3://compexp/"11-10-2019"/"01150exp.zip"');
I have bucket name: compexp inside of bucket, there are created folder name: example 11-10-2019 inside of of dated folder there are zip files for the reference see the imported image.
currently this is my reference, but i can't see how can i transfer the files from my network computers. https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html
Upvotes: 1
Views: 1274
Reputation: 71
You can use flag --recursive together with --exclude "*" --include "*.zip"
to copy only *.zip in folder "11-10-2019".
Regarding the network computers, Do you mean your internal network computers?
Upvotes: 4
Reputation: 68715
You can't pass another server as the destination to copy the contents. You need to copy the files locally first and the transfer to another server. A good way to sync a directory from S3 bucket contents is to use the sync command as mentioned here
aws s3 sync yourLocalDir s3://mybucket
Once you have all the contents synced up in your current directory you can just copy them to a different computer using scp command as mentioned here
scp -r yourLocalDir anotherHost:/directory
-r option of scp is to make sure you copy all the subdirectories recursively
Upvotes: 1