s3cmd with WebShield S3
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 full bucket name including the account prefix (for example,
u42-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 host set for both the API and the bucket URL, and path-style addressing (leave %(bucket)s out of the host template). 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 is what forces path-style addressing, which WebShield requires.
Everyday commands
Section titled “Everyday commands”s3cmd ls # list bucketss3cmd ls s3://u42-backups/ # list objectss3cmd put ./dump.sql.gz s3://u42-backups/db/ # uploads3cmd get s3://u42-backups/db/dump.sql.gz . # downloads3cmd sync ./media/ s3://u42-backups/media/ # sync a directorys3cmd del s3://u42-backups/db/dump.sql.gz # deleteLarge files are uploaded with multipart upload automatically.
- Buckets are created and deleted only in the control panel;
s3cmd mb/s3cmd rbare not available. - If the account balance goes negative, storage becomes read-only:
put/syncuploads fail while downloads keep working. Top up the balance to restore writes.