S3cmd
is a CLI client for managing data in AWS S3, Google Cloud Storage or any cloud storage service provider that uses the s3 protocol. S3cmd
is open source and is distributed under the GPLv2 license.
In this recipe we will learn how to configure and use S3cmd to manage data with MinIO Server.
Install MinIO Server from here.
Install S3cmd
from http://s3tools.org/s3cmd.
We will run S3cmd
on https://play.min.io:9000.
Access credentials shown in this example belong to https://play.min.io:9000. These credentials are open to public. Feel free to use this service for testing and development. Replace with your own MinIO keys in deployment.
Edit the following fields in your s3cmd configuration file ~/.s3cfg
# Setup endpoint
host_base = play.min.io:9000
host_bucket = play.min.io:9000
bucket_location = us-east-1
use_https = True
# Setup access keys
access_key = Q3AM3UQ867SPQQA43P2F
secret_key = zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
# Enable S3 v4 signature APIs
signature_v2 = False
s3cmd mb s3://mybucket
Bucket 's3://mybucket/' created
s3cmd put newfile s3://testbucket
upload: 'newfile' -> 's3://testbucket/newfile'
s3cmd get s3://testbucket/newfile
download: 's3://testbucket/newfile' -> './newfile'
s3cmd sync newdemo s3://testbucket
upload: 'newdemo/newdemofile.txt' -> 's3://testbucket/newdemo/newdemofile.txt'
s3cmd sync s3://testbucket otherlocalbucket
download: 's3://testbucket/cat.jpg' -> 'otherlocalbucket/cat.jpg'
s3cmd ls s3://
2015-12-09 16:12 s3://testbbucket
s3cmd ls s3://testbucket/
DIR s3://testbucket/test/
2015-12-09 16:05 138504 s3://testbucket/newfile
s3cmd del s3://testbucket/newfile
delete: 's3://testbucket/newfile'
s3cmd rb s3://mybucket
Bucket 's3://mybucket/' removed
NOTE:
The complete usage guide for S3cmd
is available here.