Skip to content

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.

  • 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).
Terminal window
# Debian/Ubuntu
sudo apt install s3cmd
# macOS
brew install s3cmd
# or via pip: pip install s3cmd

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.pro
host_bucket = s3.webshield.pro/%(bucket)s
use_https = True
signature_v2 = False

The host_bucket line with /%(bucket)s after the host is what forces path-style addressing, which WebShield requires.

Terminal window
s3cmd ls # list buckets
s3cmd ls s3://u42-backups/ # list objects
s3cmd put ./dump.sql.gz s3://u42-backups/db/ # upload
s3cmd get s3://u42-backups/db/dump.sql.gz . # download
s3cmd sync ./media/ s3://u42-backups/media/ # sync a directory
s3cmd del s3://u42-backups/db/dump.sql.gz # delete

Large files are uploaded with multipart upload automatically.

  • Buckets are created and deleted only in the control panel; s3cmd mb/s3cmd rb are not available.
  • If the account balance goes negative, storage becomes read-only: put/sync uploads fail while downloads keep working. Top up the balance to restore writes.