If you upload backups or media from Ubuntu to Storj often, using the command line is faster and more reliable than manual uploads. This guide shows a repeatable way to upload multiple files to a Storj S3 bucket with verification.
Prerequisites
- Ubuntu server with network access
- Storj S3 credentials (access key, secret key, endpoint)
awscliinstalled
sudo apt update
sudo apt install -y awscli
Configure an S3 profile for Storj
Set credentials in a dedicated profile so you do not mix providers.
aws configure --profile storj
# AWS Access Key ID
# AWS Secret Access Key
# Default region name: us-east-1
# Default output format: json
Upload a full directory
Use aws s3 cp --recursive with the Storj endpoint.
aws s3 cp /path/to/local/folder s3://your-bucket/backups/
--recursive
--endpoint-url https://gateway.storjshare.io
--profile storj
Upload only selected files
For filtered uploads (for example, only .sql and .gz files):
aws s3 cp /path/to/local/folder s3://your-bucket/backups/
--recursive
--exclude "*"
--include "*.sql"
--include "*.gz"
--endpoint-url https://gateway.storjshare.io
--profile storj
Verify objects after upload
aws s3 ls s3://your-bucket/backups/
--recursive
--endpoint-url https://gateway.storjshare.io
--profile storj
Operational tips
- Use predictable folder naming like
backups/YYYY-MM-DD/. - For cron jobs, redirect output to a log file and alert on non-zero exit codes.
- Test restores regularly, not just uploads.
Validation Commands
sudo systemctl --failed
sudo journalctl -p err -n 100
uname -a
Further reading: Ubuntu Server Documentation
Related posts: