Knowledgebase

How to Use s3cmd with RCS Object Storage Print

  • 0

Introduction

s3cmd is a popular command-line tool for managing S3-compatible object storage.

RCS Object Storage is a highly scalable solution for storing large quantities of files. Our architecture was designed from the ground up to provide high redundancy and data durability, and backed by blazing fast NVMe caching to make sure you have the best storage performance. RCS Object Storage is compatible with a subset of the S3 API. See our compatibility matrix for details.

Prerequisites

You will need:

Set Default Configuration

The s3cmd configuration file, .s3cfg, is located in your home directory. It's a plain text file that defines the default options when you run commands. You can specify a different configuration file with the -c ~/path/to/config/file command-line option. To configure RCS as the default provider, complete the steps below.

  1. Run s3cmd with the --configure option.

    $ s3cmd --configure
    
  2. Enter your access and secret keys. Find these values in your customer portal.

    Access Key: exampleNMWQSG599TB3A
    
    Secret Key: exampleCL2s4EgQRhnXafSBHCsjlsz1XVfJBeE4V
    
  3. Type ENTER to accept the default region. RCS ignores this value.

    Default Region [US]:
    
  4. Enter one of RCS's object storage hostnames for the S3 Endpoint. For example, if you choose the New Jersey location, use ewr1.RCSobjects.com.

    S3 Endpoint [s3.amazonaws.com]: ewr1.RCSobjects.com
    

    RCS's hostnames are:

    • Amsterdam: ams1.RCSobjects.com

    • New Jersey: ewr1.RCSobjects.com

    • Silicon Valley: sjc1.RCSobjects.com

    • Singapore: sgp1.RCSobjects.com

  5. Enter the DNS-style template. For example, if you choose the New Jersey location, use %(bucket)s.ewr1.RCSobjects.com.

    DNS-style bucket+hostname:port template for accessing a 
    
    bucket [%(bucket)s.s3.amazonaws.com]: %(bucket)s.ewr1.RCSobjects.com
    

    RCS's DNS-style templates are:

    • Amsterdam: %(bucket)s.ams1.RCSobjects.com

    • New Jersey: %(bucket)s.ewr1.RCSobjects.com

    • Silicon Valley: %(bucket)s.sjc1.RCSobjects.com

    • Singapore: %(bucket)s.sgp1.RCSobjects.com

  6. Optional Encryption Password: GPG encryption protects objects while stored at RCS. Setting this password does not automatically encrypt objects; it only makes the option available later. Linux users can usually accept the default path to GPG. macOS users may need to install GPG first, then locate the path with which gpg.

    Encryption password: example
    
    Path to GPG program [/usr/bin/gpg]:
    
  7. Enter ENTER to use HTTPS protocol. RCS Object Storage requires HTTPS.

    Use HTTPS protocol [Yes]:
    
  8. Optional: If your network requires an HTTP Proxy, enter that here. Otherwise press ENTER.

    HTTP Proxy server name:
    
  9. Press Y + ENTER to test the s3cmd configuration.

    Test access with supplied credentials? [Y/n] y
    
    Please wait, attempting to list all buckets...
    
    Success. Your access key and secret key worked fine :-)
    
  10. Press Y + ENTER to save the .s3cfg file.

    Save settings? [y/N] y
    
    Configuration saved to '~/.s3cfg'
    

How to Use s3cmd

For comprehensive documentation, see the official documentation. These are some of the most commonly-used commands.

Make a bucket.

s3cmd mb s3://mybucket

Remove a bucket.

s3cmd rb s3://mybucket

List the buckets.

s3cmd ls

List the objects in the bucket.

s3cmd ls s3://mybucket

Delete all objects in a bucket.

s3cmd del --recursive --force s3://mybucket

Upload a file for private access.

s3cmd put photo.jpg s3://mybucket/photo.jpg

Upload a file for public access.

s3cmd put -P photo.jpg s3://mybucket/photo.jpg

Download a file.

s3cmd get s3://mybucket/photo.jpg

Delete a file.

s3cmd rm s3://mybucket/photo.jpg

Change file permission to public access.

s3cmd setacl s3://mybucket/photo.jpg --acl-public

Change file permission to private access.

s3cmd setacl s3://mybucket/photo.jpg --acl-private

Enable public directory listing for a bucket.

s3cmd setacl s3://mybucket/ --acl-public

Disable public directory listing for a bucket.

s3cmd setacl s3://mybucket/ --acl-private

Was this answer helpful?
Back

Powered by WHMCompleteSolution