s3cmd with WebShield S3
Configure s3cmd to work with WebShield S3-compatible object storage.
s3cmd is a lightweight command-line client for S3 storage. It works with WebShield once you point it at the WebShield endpoint. See Object storage for how to obtain your keys and create buckets.
Prerequisites
Section titled “Prerequisites”- Endpoint host:
s3.webshield.pro - Access Key ID and Secret Access Key from the S3 storage page in the control panel.
- The exact bucket name from the control panel (for example,
company-backups).
Install
Section titled “Install”# Debian/Ubuntusudo apt install s3cmd# macOSbrew install s3cmd# or via pip: pip install s3cmdConfigure
Section titled “Configure”s3cmd needs the API host and a bucket URL template. For path-style addressing, create ~/.s3cfg:
[default]access_key = WSS...secret_key = <secret>host_base = s3.webshield.prohost_bucket = s3.webshield.pro/%(bucket)suse_https = Truesignature_v2 = FalseThe host_bucket line with /%(bucket)s after the host selects path-style addressing. For virtual-hosted addressing, replace it with host_bucket = %(bucket)s.s3.webshield.pro; keep the same host_base.
Everyday commands
Section titled “Everyday commands”s3cmd ls # list bucketss3cmd ls s3://company-backups/ # list objectss3cmd put ./dump.sql.gz s3://company-backups/db/ # uploads3cmd get s3://company-backups/db/dump.sql.gz . # downloads3cmd sync ./media/ s3://company-backups/media/ # sync a directorys3cmd del s3://company-backups/db/dump.sql.gz # deleteLarge files are uploaded with multipart upload automatically.
- Creating and deleting buckets requires a key with bucket management permission; see Access keys.
- If the account balance goes negative, storage becomes read-only:
put/syncuploads fail while downloads keep working. Top up the balance to restore writes.