






















s3cmd is a command-line tool for S3-compatible object storage. It works with Ceph RGW through custom endpoint configuration, making it a popular choice for scripting and admin tasks on Ceph clusters.
# On Debian/Ubuntu
apt-get install s3cmd
# On RHEL/CentOS (from the EPEL RPM repository)
dnf install s3cmd
# Via pip
pip install s3cmdRun the interactive configuration:
s3cmd --configureOr create the config file directly at ~/.s3cfg. For the common path-style setup against a Rook RGW service, point both host_base and host_bucket at the RGW endpoint:
[default]
access_key = myaccesskey
secret_key = mysecretkey
host_base = rook-ceph-rgw-my-store.rook-ceph:80
host_bucket = rook-ceph-rgw-my-store.rook-ceph:80
use_https = False
signature_v2 = FalseCreate a bucket:
s3cmd mb s3://my-bucketUpload a file:
s3cmd put /tmp/report.pdf s3://my-bucket/reports/report.pdfList objects:
s3cmd ls s3://my-bucket/Download a file:
s3cmd get s3://my-bucket/reports/report.pdf /tmp/report-downloaded.pdfDelete an object:
s3cmd del s3://my-bucket/reports/report.pdfs3cmd sync /var/data/ s3://my-bucket/data/ \
--delete-removed \
--progressMake an object publicly readable:
s3cmd setacl s3://my-bucket/public-file.txt --acl-publicRestrict to owner only:
s3cmd setacl s3://my-bucket/private-file.txt --acl-privates3cmd info s3://my-bucket
s3cmd info s3://my-bucket/reports/report.pdfs3cmd put /var/data/large-backup.tar.gz s3://my-bucket/backups/ \
--multipart-chunk-size-mb=100s3cmd du s3://my-bucket
s3cmd du s3://my-bucket/reports/s3cmd is a versatile CLI tool that works with Ceph RGW by pointing host_base and host_bucket at the RGW endpoint. It supports common S3 operations and is well-suited for shell scripts that need to interact with Ceph object storage.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。