> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://wiki.leviia.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# S3cmd: configuration and use

## Prerequisites
* [Install s3cmd](https://s3tools.org/download)
* [Have created your identifier](https://wiki.leviia.com/en/article/create-object-storage-identifier-in-your-leviia-dashboard-1as7ljn/)

## Configuring s3cmd
* Execute the configuration command 
```bash
s3cmd --configure
```

```bash
Access Key: <available in dashboard leviia>
Secret Key: <available in dashboard leviia>

Default Region: default
S3 Endpoint: <available in dashboard leviia>
DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)s.{endpoint}
Encryption password: 
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: True
HTTP Proxy server name: 
HTTP Proxy server port: 0
Test access with supplied credentials? [Y/n] y
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Not configured. Never mind.

Save settings? [y/N] y
```
## s3cmd settings
To optimize s3cmd for your Internet connection, you can set the size of packets sent.
To do this, simply use the following option:

`
--multipart-chunk-size-mb=5000
` 

The default value is 15, but you can go as low as 5 (slow upload rate) or as high as 5000 (ultra-fast upload rate).
We recommend testing different settings to suit your needs. 
## Using s3cmd
### Information bucket
* List buckets  
 `s3cmd ls`
* List bucket contents
 `s3cmd ls s3://<bucket_name>`
 * Get the size of your bucket
`s3cmd du s3://<bucket_name>` 

### Action on bucket
* Create a new bucket
 `s3cmd mb s3://<bucket_name>`
* Delete a bucket
`s3cmd rb s3://<bucket_name>`

### File management
* Send a file to the new bucket
 `s3cmd put index.html s3://<bucket_name> --multipart-chunk-size-mb=5000`
* Send a file to the new bucket
 `s3cmd put -r myfolder s3://<bucket_name> --multipart-chunk-size-mb=5000`
* Download a file
`s3cmd get s3://<bucket_name>/file.html --multipart-chunk-size-mb=5000`
* Move a file (only if on the same bucket)
`s3cmd mv s3://<bucket_name>/file1/file.html s3://<bucket_name>/file2/file.html`