s3cl - Command line for Amazon s3 cloud storage
s3cl command [options]
s3cl buckets s3cl mkbucket --bucket some_bucket_name --jurisdiction [EU|US] s3cl ls <bucket>:[prefix] s3cl cp <bucket>:<key> /path/[filename] s3cl sync <bucket>:[prefix] /path/ s3cl sync_up [--acl_short=public-read] /path/ <bucket>:[prefix] s3cl rm <bucket>:<key> Options: -help brief help message -man full documentation We take NO responsibility for the costs incured through using this script. To run this script, you need to set a pair of environment variables: AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_SECRET
This program gives a command line interface to Amazons s3 storage service. It does not limit the number of requests (which may cost you more money than if you did it a different way!) and each request costs Money (although some costs from EC2 may be $0.0, check latest from Amazon costs page) - we take NO reponsibility for your bill.
Pedro Figueiredo <email@example.com>
This software is copyright (c) 2013 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
List all buckets for this account.
s3cl mkbucket --bucket sombucketname [--jurisdiction [EU|US]]
Create a new bucket, optionally specifying what jurisdiction it should be created in.
s3cl ls <bucket>:[prefix]
List contents of a bucket, the optional prefix can be partial, in which case all keys matching this as the start of the key name will be returned. If no prefix is supplied all keys of the bucket will be returned.
s3cl cp <bucket>:<key> target_file
s3cl cp <bucket>:<key> target_directory
Copy a single key from the bucket to the target file, or into the target_directory.
s3cl sync <bucket>:[prefix] target_dir
Downloads all files matching the prefix into a directory structure replicating that of the prefix and all 'sub-directories'. It will download ALL files - even if already on your local disk:
# Data transfer "in" and "out" refers to transfer into and out # of Amazon S3. Data transferred between Amazon EC2 and # Amazon S3, is free of charge (i.e., $0.00 per GB), except # data transferred between Amazon EC2 and Amazon S3-Europe, # which will be charged at regular rates.
s3cl sync_up [--acl_short=public-read] /path/ <bucket>:[prefix]
Upload all the files below /path/ to S3, with an optional prefix at the start of the key name. The existing S3 files and meta data are fetched from S3 and the md5 (etag) is compaired to what is on the local disk, files are not upload if the content has not changed.
Use --acl_short to set access control, options from Net::Amazon::S3::Bucket#set_acl this is only applied when the file is uploaded.
Each files content-type is worked out using MIME::Types, if this does not match 'text/plain' is used for ASCII text files, otherwise a warning is issued and the file is NOT uploaded.
Currently this does NOT remove old files from S3, and if there is any change to a file then the entire file will be reuploaded.
s3cl rm <bucket>:<key>
Remove a key(file) from the bucket, removing a non-existent file is not classed as an error. Once removed the key (file) can not be restored - so use with care!
This module contains code modified from Amazon that contains the following notice (which is also applicicable to this code):
# This software code is made available "AS IS" without # warranties of any kind. You may copy, display, modify and # redistribute the software code either by itself or as incorporated # into your code; provided that you do not remove any proprietary # notices. Your use of this software code is at your own risk and # you waive any claim against Amazon Digital Services, Inc. or its # affiliates with respect to your use of this software code. # (c) 2006 Amazon Digital Services, Inc. or its affiliates.
Leo Lapworth <LLAP@cuckoo.org> - Part of the HinuHinu project