← ClaudeAtlas

cloud-backuplisted

云备份方案
ryukyagamilight/terminal-skills · ★ 1 · AI & Automation · score 75
Install: claude install-skill ryukyagamilight/terminal-skills
# 云备份方案 ## 概述 S3/OSS 备份、跨区域复制、生命周期管理技能。 ## AWS S3 备份 ### 基础操作 ```bash # 上传文件 aws s3 cp backup.tar.gz s3://my-bucket/backups/ # 上传目录 aws s3 sync /backup s3://my-bucket/backups/ # 下载 aws s3 cp s3://my-bucket/backups/backup.tar.gz ./ aws s3 sync s3://my-bucket/backups/ /restore/ # 列出文��� aws s3 ls s3://my-bucket/backups/ aws s3 ls s3://my-bucket/backups/ --recursive ``` ### 高级选项 ```bash # 排除文件 aws s3 sync /backup s3://my-bucket/ --exclude "*.log" # 存储类型 aws s3 cp backup.tar.gz s3://my-bucket/ --storage-class STANDARD_IA aws s3 cp backup.tar.gz s3://my-bucket/ --storage-class GLACIER # 服务端加密 aws s3 cp backup.tar.gz s3://my-bucket/ --sse AES256 aws s3 cp backup.tar.gz s3://my-bucket/ --sse aws:kms --sse-kms-key-id alias/my-key # 多部分上传 aws s3 cp large-file.tar.gz s3://my-bucket/ --expected-size 10737418240 ``` ### 生命周期策略 ```json { "Rules": [ { "ID": "BackupLifecycle", "Status": "Enabled", "Filter": {"Prefix": "backups/"}, "Transitions": [ {"Days": 30, "StorageClass": "STANDARD_IA"}, {"Days": 90, "StorageClass": "GLACIER"} ], "Expiration": {"Days": 365} } ] } ``` ```bash # 应用策略 aws s3api put-bucket-lifecycle-configuration \ --bucket my-bucket \ --lifecycle-configuration file://lifecycle.json ``` ### 跨区域复制 ```bash # 启用版本控制 aws s3api put-bucket-versioning \ --bucket source-bucket \ --versioning-configuration Status=Enabled # 配置复制规则 aws s3api put-bucket-replication \ --bucket source-bucket