This site is for my reference purpose and I hope this will also help others to learn and know about the latest technologies.

Main menu

Post navigation

s3cmd Elaborated…

Use –rr option (reduced redundancy) for every put and sync commands !!!. Use –bucket-location option to mention nearest geographical location to avoid latency.

To view contents inside a bucket#s3cmd ls s3://bucketname

To copy/sync a directory into a bucket#s3cmd sync Desktop/check s3://bucket_name

To view all contents of all buckets one level down (only non empty buckets)#s3cmd la -H

To sync contents of a local dir in a buckter under an existing directory (s3 object)#s3cmd sync Desktop/checkunni/ s3://writingz/check/

To sync remote s3 contents to a local directory#s3cmd sync s3://writingz/check/ Desktop/checkunni/

To sync contents of a local dir in a bucket under a new directory name#s3cmd sync Desktop/checkunni/ s3://homie/newname/
Here newname directory is created on the fly and files of checkunni are copied inside s3://homie/newname

Copy a non-empty directory (on s3) from one bucket to another bucket#s3cmd -r cp s3://homie/newname s3://writingz/

Copy a non-empty directory (on s3) from one bucket to another bucket under a new name#s3cmd -r cp s3://homie/newname s3://writingz/newname2/

To find the size of a bucket/directory#s3cmd du -H s3://writingz

To download only a single file #s3cmd get s3://homie/dirname/filename .

To download a remote directory locally.#s3cmd get -rf s3://writingz/checkunni . use a / (forward slash) after checkunni to download only the files in it.

To upload a single file #s3cmd put PSY.mp3 s3://homie/newname/

To upload a local dir to bucket #s3cmd put -rf s3test s3://homie/newname/

Delete a file #s3cmd del s3://writingz/abc.jpg

Delete a directory #s3cmd del -rf s3://writingz/check/

Move a file (can also be used for rename with files only) #s3cmd mv s3://writingz/abc.png s3://haye/