Installation
S3CMD installation instructions for your platform can be found on the official s3cmd website https://s3tools.org/s3cmd, but for our example we will use macOS and brew package manager.
$ brew install s3cmd
Configure
Prior usage we need to configure s3cmd. The easiest way is to directly put the configuration parameters into the default configuration file section.
$ vi ~/.s3cfg
We only need four parameters (replace the asterix signs with the values from the keys page: https://account.storadera.com/key).
[default]
access_key = ***
secret_key = ******
host_base = eu-east-1.s3.storadera.com
host_bucket = eu-east-1.s3.storadera.com
If you prefer to avoid creating configuration files, you can fully rely on command line arguments. In this case you need to provide the following arguments with every s3cmd command you want to execute.
$ s3cmd --access_key="***" --secret_key="******" --host="eu-east-1.s3.storadera.com" --host-bucket="eu-east-1.s3.storadera.com" ls
$ s3cmd --access_key="***" --secret_key="******" --host="eu-east-1.s3.storadera.com" --host-bucket="eu-east-1.s3.storadera.com" mb s3://test-bucket
Creating buckets
Buckets can be listed and created through our web interface https://account.storadera.com. But the same result can also be achieved via command line.
Create a bucket.
$ s3cmd mb s3://test-bucket
List buckets.
$ s3cmd ls
List objects in a bucket.
$ s3cmd ls s3://test-bucket
List one “folder” in a bucket.
$ s3cmd ls s3://test-bucket/my-folder
Uploading files and directories
Upload one file.
$ s3cmd put /data/test.txt s3://test-bucket/test.txt
Upload a full directory.
$ s3cmd --recursive put /data/my-folder s3://test-bucket/
$ s3cmd ls s3://test-bucket/my-folder/
References
Full reference of s3cmd commands: https://s3tools.org/usage