Copy or Move files from EC2 to S3 Bucket

The following command helps in copying or moving the files from Jump Server / EC2 instance to the S3 bucket.

move files from EC2 to S3

To move file from EC2 to S3
aws  s3  mv  backup.sql  s3://yourbucket.mysqlbackups/yourinstancebucket/
To copy file from EC2 to S3
aws  s3  cp backup.sql  s3://yourbucket.mysqlbackups/yourinstancebucket/

Before you run the aforementioned commands, take note of the following.

  • The buckets need to be present in S3.
  • To complete the task, you must possess the necessary authorizations.
  • If you move a file, it will be moved from its existing location.
  • The files will be accessible in both EC2 and S3 if you copy them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s