Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell script to Upload files from AWS EC2 to S3

I am executing jmeter on AWS EC2, result of which is returned in the form csv file.

I need to upload this csv file to AWS S3 bucket.

Since I am creating number of EC2 instances dynamically and executing jmeter on those instances, it's better to automate this process .

So for this I want to write shell script (as a user data) to execute jmeter and upload result CSV file to S3 bucket from each EC2 instance.

How i can write script for this ?

like image 211
Pravin Avatar asked Apr 21 '13 06:04

Pravin


People also ask

Can we copy folder from EC2 to S3?

You can transfer data between compute instances and Amazon S3 buckets on the same Snowball Edge device. You do this by using the supported AWS CLI commands and the appropriate endpoints. For example, assume that you want to move data from a directory in my sbe1.

Which CLI command is used to upload files to an S3 bucket?

(Recommended) Upload the file using high-level (aws s3) commands. This example uses the command aws s3 cp, but other aws s3 commands that involve uploading objects into an S3 bucket (for example, aws s3 sync or aws s3 mv) also automatically perform a multipart upload when the object is large.


1 Answers

Consider using command line s3 clients.

S3 command line tools

Also go through some of these sites :

Shell Script To Transfer Files From Amazon S3 Bucket.

aws command line tools

python script to upload file to s3

like image 82
Jeevan Patil Avatar answered Sep 28 '22 08:09

Jeevan Patil