Skip to main content
S3cmd
Last update:

S3cmd

S3cmd is a command-line interface for working with services that support Amazon S3 HTTP API (S3 API).

Customize S3cmd

  1. Configure access.
  2. Install client.
  3. Create S3cmd configuration.

1. Configure access

Access can be configured by a user with role Account Owner or User Administrator.

  1. Create a service user with a role with access to object storage, see Role Model Access for details.
  2. Issue the user an S3 key.

2. Install the client

From GitHub S3cmd download and install the client.

3. Create s3cmd configuration

  1. Open the terminal.

  2. Open the configuration mode:

    s3cmd --configure
  3. Enter Access Key — the value of the Access key field from S3-key.

  4. Enter Secret Key — the value of the Secret key field from the S3 key.

  5. Enter Default Region — pool.

  6. Enter S3 Endpoint — s3.ru-1.storage.selcloud.ru where ru-1 is pool.

  7. Enter the DNS-style bucket+hostname:port template for accessing a bucket — s3.ru-1.storage.selcloud.ru. The settings will be saved in the ~/.s3cfg file:

    [default]
    access_key = <access_key>
    secret_key = <secret_key>
    bucket_location = ru-1
    host_base = s3.ru-1.storage.selcloud.ru
    host_bucket = s3.ru-1.storage.selcloud.ru

Working with S3cmd

See the Usage instructions of the S3cmd documentation for all commands.

Create a container

Create a container:

s3cmd mb s3://<container_name>

Specify <container_name> as the name of the new container.

View a list of facilities

Check out the list of facilities:

s3cmd ls s3://<container_name>

Specify <container_name> is the name of the container.

Download the object

Load the object:

s3cmd put <path> s3://<container_name>/<prefix>

Specify:

  • <path> — path to the file in the local directory;
  • <container_name> is the name of the container;
  • <prefix> — Optional: prefix, by which the object will be loaded.

Delete object

Delete the object:

s3cmd rm s3://<container_name>/<object_name>

Specify:

  • <container_name> is the name of the container;
  • <object_name> is the name of the object.