Wednesday, July 25, 2012

upload and downloads to amazon (s3) bucket


Uploading and downloading files to amazon (s3) buckets from internet

Now-a-days some many online storage of data is provided by the many providers like that amazon is providing online data storage S3 for storage of the data it can used for upload and downloading the files
in the cloud and it can be accesed by the public internet. To upload and download of the files from the any system which is having internet. For this you have to install the following package.

# apt-get install -y s3cmd

#s3cmd –configure

while configuring the s3cmd package it will ask for the access id of your amazon and also the secret key the n select all as ok while installing
after this the installation will be completed.

To see the content of you s3 bucket it will show like this
#s3cmd ls
here it will display the files and folders of your s3 bucket some what like this
s3://Backup_daily
s3://newfolder_weakly
cmd to check List of s3buckets:
#s3cmd ls



List of contents in a Bucket:
#s3cmd ls s3://backups.exleaz.com



Uploading an image or any file/folder to s3 bucket:
#s3cmd -P put /root/Desktop/IMAGE/8.jpg s3://MClouds-757cf3e2e4/
#s3cmd -P put /root/Desktop/myproj.rar s3://MClouds-757cf3e2e4/
#s3cmd -P put /root/Desktop/myproj.rar s3://MClouds-757cf3e2e4/



Deleting an image from the s3bucket:
#s3cmd del s3://MClouds-757cf3e2e4/8.jpg



Downloading an image/file from the s3bucket:
#s3cmd get s3://BUCKET/OBJECT LOCAL_FILE
#s3cmd get s3://MClouds-757cf3e2e4/8.jpg /root/Desktop/myproj/



syncing a bucket to a local folder:
#s3cmd sync s3://MClouds-757cf3e2e4 /root/Desktop/s3tolo/

1 comment: