CyberKeeda In Social Media

S3cmd - A faster way for AWS S3 Operations.


S3cmd


A very faster and reliable CLI tool for AWS object storage (S3) operations.


So this tutorial is just a walk through to
  • How to install s3cmd
  • How to configure S3cmd
  • Basic operations copy, move, list.

Requirements.
  • AWS Console access.
  • API Token for same account.
  • PIP is installed within Windows system to install python packages

Installation.

For Windows
pip install s3cmd
For Linux
sudo apt-get install s3cmd -y


Configuration.

Before we proceed to run cli commands, let configure s3cmd configuration file to authenticate.

For Linux -
Toggle to home directory of your account.

# cd ~
Create an empty hidden file named as .s3cfg

# touch .s3cfg
Add the below lines and add your own access_key and secret_key and save.

[default]

# Login credentials
access_key = AKMYOWNACCESSKEYHDEG
secret_key = 1DwMYownAccessSecretKeyoOV8

Now we are ready to do s3 operations using s3cmd cli, all cli commands are same for windows and linux operating systems.


Object Storage operations.

  • List content of your S3 Bucket.
# s3cmd ls s3://<Your AWS Bucket Name/
  • Create an new Bucket
# s3cmd mb s3://my_own_s3_newbucket/
  • Uploading content within a Bucket.
# s3cmd put myfile1.txt myimage.jpg s3://my_own_s3_newbucket/
    • Download content from Bucket.
    # s3cmd get s3://my_own_s3_newbucket/myimage.jpg myimage.jpg
    • Remove and existing Bucket
    # s3cmd rb s3://my_own_s3_newbucket/
      • Move content of one bucket(Source) to another(Destination).
      # s3cmd mv --recursive s3://failed/ s3://old_failed/



      No comments:

      Post a Comment

      Related Posts Plugin for WordPress, Blogger...
      Designed By Kunal Saha