Using MinIO Client (mc) with OtterStorage
Install and configure the mc command-line client to manage your OtterStorage buckets: create, list, copy, and mirror data.
MinIO Client (mc) is an S3-compatible command-line tool that lets you manage your OtterStorage buckets quickly and in a scriptable way. Since OtterStorage is fully S3 API-compatible, mc works without modifications: just point it at our endpoint and use your access keys. In this guide you'll see how to install it, configure an alias, and work with the most common commands, including mirroring (mirror) for backups.
Install mc
The mc binary is available for Linux, macOS, and Windows. Download it directly from the official MinIO repository.
Linux
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin/mc
macOS
brew install minio/stable/mc
Windows
Download the executable and add it to your PATH, or invoke it directly from PowerShell:
Invoke-WebRequest -Uri https://dl.min.io/client/mc/release/windows-amd64/mc.exe -OutFile mc.exe
.\mc.exe --version
Verify the installation on any platform with:
mc --version
Configure the OtterStorage alias
An alias is a short name that associates the OtterStorage endpoint with your credentials. Once created, all commands run against that alias. In OtterStorage each bucket has its own key pair (access key + secret key), which you obtain from the console when you create the bucket.
mc alias set otter https://es-mad-1.s3.otterstorage.io ACCESS_KEY SECRET_KEY
Replace ACCESS_KEY and SECRET_KEY with your bucket's credentials. From here on, otter is the name of the connection. Verify that the alias works by listing the contents of your bucket:
mc ls otter/mi-bucket
If you need to specify the region explicitly in some workflow, OtterStorage uses identifiers such as eu-mad. Most mc commands do not require specifying the region, since it is resolved through the endpoint.
To review or remove a saved alias:
mc alias list
mc alias remove otter
Buckets are created in the console
ℹ️ In OtterStorage, buckets are created from the console, not with mc mb: your keys are scoped to a single bucket. With mc you work with the objects of an existing bucket. Create a bucket in the console.
List contents: mc ls
Use mc ls to list the folders and objects in a bucket. Add --recursive to traverse the entire tree.
mc ls otter/mi-bucket
mc ls --recursive otter/mi-bucket
Copy objects: mc cp
The mc cp command copies files between your local system and OtterStorage, or between buckets. To upload a single file:
mc cp informe.pdf otter/mi-bucket/
To download an object to your machine:
mc cp otter/mi-bucket/informe.pdf ./descargas/
To copy between two OtterStorage buckets:
mc cp otter/mi-bucket/informe.pdf otter/backups/
Recursive copy: mc cp --recursive
To upload or download an entire directory with its structure, add --recursive (abbreviated -r):
mc cp --recursive ./sitio-web/ otter/assets/sitio-web/
This copies all the files in the local directory ./sitio-web/ while keeping the subfolders. Unlike other providers, at OtterStorage we don't charge by number of requests, so copying thousands of small objects generates no extra charges for the PUT operations involved.
Mirror data: mc mirror
mc mirror synchronizes a source with a destination, copying only what has changed. It's the ideal option for incremental backups and for keeping two locations identical. Unlike cp --recursive, mirror compares source and destination and transfers only the new or modified files.
mc mirror ./datos-local/ otter/backups/datos/
Useful mirror options
--overwrite: overwrites in the destination the objects that have changed in the source.--remove: deletes in the destination the objects that no longer exist in the source (exact mirror).--watch: watches the source continuously and replicates changes in real time.--exclude: skips files matching a pattern (for example"*.tmp").
Example: daily incremental backup
A mirror that keeps the bucket identical to the source directory, deleting what has been removed locally and excluding temporary files:
mc mirror --overwrite --remove --exclude "*.tmp" ./produccion/ otter/backups/produccion/
You can schedule it with cron so it runs every night:
0 2 * * * /usr/local/bin/mc mirror --overwrite --remove /srv/produccion/ otter/backups/produccion/ >> /var/log/mc-backup.log 2>&1
Since OtterStorage doesn't charge for requests or deletes, the --remove option and the object verification that mirror performs on each run add no per-operation cost: you only pay for the storage your data occupies.
Example: real-time synchronization
To continuously replicate a folder as it changes, use --watch:
mc mirror --watch --overwrite ./uploads/ otter/assets/uploads/
Check usage: mc du
mc du (disk usage) shows the space used by a bucket or prefix, useful for auditing the size of your backups.
mc du otter/backups
mc du --recursive otter/backups/produccion/
Delete objects: mc rm
mc rm deletes objects. Use it carefully, especially with --recursive.
mc rm otter/mi-bucket/informe.pdf
To delete an entire directory in the bucket, combine --recursive with --force:
mc rm --recursive --force otter/mi-bucket/carpeta-antigua/
Empty and delete a bucket entirely:
mc rm --recursive --force otter/mi-bucket
mc rb otter/mi-bucket
Deleting objects in OtterStorage has no cost: we don't bill DELETE operations, so you can clean up obsolete data without penalty.
Next steps
With the alias configured, you can now integrate mc into your deployment and backup scripts. To learn about other ways to connect with OtterStorage (SDKs, AWS CLI, or additional integrations), see the documentation.
Ready to try it?
Create your account and get your keys in minutes.