https://github.com/suyesh/s3_patron
Command line utility for s3 written in Ruby
https://github.com/suyesh/s3_patron
amazon-s3-storage ruby ruby-aws ruby-s3 rubygem rubygems s3-ruby-aws
Last synced: 19 days ago
JSON representation
Command line utility for s3 written in Ruby
- Host: GitHub
- URL: https://github.com/suyesh/s3_patron
- Owner: suyesh
- License: mit
- Created: 2017-01-03T17:05:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T15:46:28.000Z (over 9 years ago)
- Last Synced: 2025-10-09T21:09:50.328Z (8 months ago)
- Topics: amazon-s3-storage, ruby, ruby-aws, ruby-s3, rubygem, rubygems, s3-ruby-aws
- Language: Ruby
- Homepage: https://github.com/suyesh/s3_patron
- Size: 23.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# S3-Patron - Command-line utility for S3 written in Ruby

S3-Patron lets you list, upload, download to and from s3 using your terminal
## Setup
Make sure [Ruby](https://www.ruby-lang.org/en/documentation/installation/) is installed.
Execute:
```
$ gem install s3_patron
```
Set ENV variables
```
$ export AWS_ACCESS_KEY_ID="YOUR AWS ACCESS KEY"
$ export AWS_SECRET_ACCESS_KEY="YOUR AWS SECERET KEY"
$ export AWS_REGION="AWS REGION"
```
## Usage
```shell
#List of Commands:
$ s3patron buckets [REGION(OPTIONAL)] # List all buckets
$ s3patron create [BUCKET_NAME] [REGION(OPTIONAL)] # create bucket
$ s3patron download [BUCKET_NAME] [OBJECT] [DOWNLOAD_LOCATION(default=CURRENT DIR)] [REGION(default=ENV[AWS_REGION])] # Download object from bucket
$ s3patron help [COMMAND] # Describe Commands
$ s3patron list [BUCKET_NAME] [REGION(OPTIONAL)] # List objects inside bucket
$ s3patron upload [BUCKET_NAME] [FILE] [REGION(OPTIONAL)] # Upload into bucket
#You can also use s3p instead of s3patron
```
#Examples
##List Buckets
```shell
#Normal
$ s3patron buckets
# Will list all buckets in your s3. By default it lists first 50 items
$ s3patron buckets -a
# passing -a flag will list all items with no limit.
$ s3patron buckets -l 10 #will show first 10 buckets
# You can customize number of results by passing -l flag followed by limit
#You can also use s3p instead of s3patron
```
##Create Bucket
```shell
#Normal
$ s3patron create example_bucket
# Will create a bucket named example_bucket
#Optional
# If you do not want to use the AWS REGION defined in env variables you can pass region as next argument to create
$ s3patron create example_bucket us-east-1
#You can also use s3p instead of s3patron
```
##List Objects inside the bucket
```shell
#Normal
$ s3patron list example_bucket
# Will list all objects inside example_bucket in your s3. By default it lists first 50 items
$ s3patron list example_bucket -a
# passing -a flag will list all items with no limit.
$ s3patron list example_bucket -l 10 #will show first 10 buckets
# You can customize number of results by passing -l flag followed by limit
#You can also use s3p instead of s3patron
```
##Upload into a bucket
```shell
#Normal
$ s3patron upload example_bucket example_file.txt
# Will upload example_file.txt to example_bucket
#Optional
# If you do not want to use the AWS REGION defined in env variables you can pass region as next argument
#You can also use s3p instead of s3patron
```
##Download object from bucket
```shell
#Normal
$ s3patron download example_bucket example_file.txt
# Will download example_file.txt to current directory
#Optional
# If you do not want to use the AWS REGION defined in env variables you can pass region as next argument
#You can also use s3p instead of s3patron
```
#TODO: Set permissions on objects, encryption properties and storage class properties
##Rubygems.org
Hosted at [Rubygems.org](https://rubygems.org/gems/s3_patron)
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).