Wednesday, December 19, 2007

Amazon S3 useful commands with S3Sync

If you are using Amazon's S3 service for Simple Storage (offsite backups) in conjunction with the S3Sync Project then there are some simple commands that may be of benefit to you

From the command line browse to the directory that hold the file s3cmd.rb

To list all available buckets type
./s3cmd.rb listbuckets


To create a bucket
./s3cmd.rb createbucket BucketName


To list all files within a bucket
./s3cmd.rb list BucketName


To list all files within a key
./s3cmd.rb list BucketName:Key


To drill down into folders in a bucket
./s3cmd.rb list BucketName:Key/folder1/folder2


To copy a directory from a bucket to your local computer
./s3sync.rb -r BucketName:Key/folder/subfolder /somedirectory

No comments: