Some more command to use s3 Bucket on CentOS/RHEL
By Anuket Jain On 8 May 2015 In AWS Tools
With the help of this tutorial you can use s3 bucket using command
Sometime we make some changes in files so except copy all the or copy file individually, we can use sync switch with s3cmd command. It will sync all those files in which changes happen
# s3cmd sync backup/ s3://techoism or # s3cmd sync s3://techoism backup/
backup/tech3.txt -> s3://techoism/tech3.txt [1 of 1] 38 of 38 100% in 0s 721.80 B/s done Done. Uploaded 38 bytes in 1.0 seconds, 38.00 B/s. Copied 0 files saving 0 bytes transfer.
We use following command to check the disk usage in bucket
# s3cmd du s3://techosim
If we have to check the size of all the buckets then we use following command:
# s3cmd du s3://
1110 s3://techoism/ 1620651 s3://techoism_DB/ 368881866 s3://techoism_code/ -------- 370503627 Total
We can get various information about Buckets using following command.
# s3cmd info s3://techoism
s3://techoism/ (bucket): Location: us-east-1 Expiration Rule: none policy: none ACL: technical: FULL_CONTROL
We can also check the information on any individual file.
# s3cmd info s3://techoism/tech3.txt
s3://techoism/tech3.txt (object): File size: 38 Last mod: Wed, 06 May 2015 10:13:20 GMT MIME type: text/plain MD5 sum: f9448e5a6584bcc3d8b8324abe089437 SSE: NONE policy: none ACL: technical: FULL_CONTROL
We can copy files from a bucket to any other bucket
# s3cmd cp s3://techoism/tech3.txt s3://techoism_code/
File s3://techoism/tech3.txt copied to s3://techoism_code/tech3.txt
We can move files from a bucket to any other bucket
# s3cmd mv s3://techoism/tech3.txt s3://techoism_code/
File s3://techoism/tech3.txt moved to s3://techoism_code/tech3.txt
Some time we run website from s3 Bucket, so that we use following command to create website for s3 bucket.
# s3cmd ws-create s3://techoism
Bucket 's3://techoism/': website configuration created.
Use following command to remove the website from s3 Bucket.
# s3cmd ws-delete s3://BUCKET
Bucket 's3://techoism/': website configuration deleted.
Following command give infomation of website configuration.
# s3cmd ws-info s3://BUCKET
Bucket s3://techoism/: Website configuration Website endpoint: http://techoism.s3-website-us-east-1.amazonaws.com/ Index document: index.html Error document: None