osscmd的使用示例

2025-07-27 10:47:03

配置一个lifecycle的xml格式的文本文件

1125

log_backup/

Enabled

2

表示删除Bucket下以log_backup/ 为前缀,并且相对当前时间超过2天的Object。详细的规则配置可以参考API文档

写入lifecycle

python osscmd putlifecycle oss://mybucket lifecycle.xml

0.150(s) elapsed读取lifecycle

python osscmd getlifecycle oss://mybucket

1125

log_backup/

Enabled

2

0.027(s) elapsed删除lifecycle

python osscmd deletelifecycle oss://mybucket

0.139(s) elapsed读取lifecyle

python osscmd getlifecycle oss://mybucket

Error Headers:

[('content-length', '288'), ('server', 'AliyunOSS'), ('connection', 'close'), ('x-oss-request-id', '54C74FEE5D7F6B24E5042630'), ('date', 'Tue, 27 Jan 2015 08:44:30 GMT'), ('content-type', 'application/xml')]

Error Body:

mybucket

NoSuchLifecycle

No Row found in Lifecycle Table.

54C74FEE5D7F6B24E5042630

mybucket.oss-maque-hz-a.alibaba.net

Error Status:

404

getlifecycle Failed!

    一举多得
    做好准备:8.0若干同盟种族解锁条件曝光

    Copyright © 2022 摩洛哥世界杯_直播世界杯决赛 - dgaida.com All Rights Reserved.