Tuesday 29 October 2013

S3cmd Put and Get Commands

S3cmd

S3cmd is a command line tool for uploading, retrieving and managing data in Amazon S3. It is best suited for users who don't fear command line. It is also ideal for scripts, automated backups triggered from cron, etc.


Upload data to S3 bucket

For a single file to upload in bucket :

s3cmd put filetoupload.xxx s3://mainbucket/targetfolder/filetoupload.xxx

For a folder to upload in bucket :

s3cmd put --recursive  directorytoupload s3://mainbucket/subfolder/directorytoupload

Download data from S3 Bucket

For a single file to download from bucket :

s3cmd get s3://mainbucket/subfolder/filetodownload.xxx

For a folder to download from bucket :

s3cmd get --recursive s3://mainbucket/subfolder/directoytodownload

Regards,
Muhammad Kamran Ayub