s3cmd是一个用来操作s3接口的客户端。
安装
pip install s3cmd
或
yum install python-s3cmd
推荐版本 2+,2.0.0 版本之前测试过有bug,附录部分有说明。
配置
-
通过命令行传递参数配置
s3cmd --configure \
--access_key=<access_key> \
--secret_key=<secret_key> \
--region=<region> \
--host=<endpoint> \
--host-bucket=<endpoint> \
--no-ssl -
通过配置文件配置
~/.s3cfg
[default]
access_key = <access_key>
secret_key = <secret_key>
bucket_location = <region>
host_base = <endpoint>
host_bucket = <endpoint>
use_http