一键导入
tigris-lifecycle-management
Use when setting up automatic object expiration, storage tier transitions, TTL-based deletion, or cleanup rules for Tigris buckets
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when setting up automatic object expiration, storage tier transitions, TTL-based deletion, or cleanup rules for Tigris buckets
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Back up and restore the OpenClaw state directory (config, workspace, sessions, skills) to a Tigris bucket. Scheduled backups, safe SQLite handling, point-in-time rollback via bucket snapshots, and zero-copy clones via forks. Use when the user wants their assistant's state to survive machine loss, move to a new machine, or roll back to before a bad update.
Use when migrating from AWS S3, Google Cloud Storage, or Azure Blob to Tigris — shadow buckets via `tigris buckets set-migration`, active drain via `tigris buckets migrate`, bulk copy, SDK endpoint swap, zero-downtime migration
Use when working with Tigris file storage - uploading, downloading, deleting, listing files, presigned URLs, client uploads, or setting up Tigris CLI and SDK. Covers Next.js, Remix, Express, Rails, and Laravel. For Python/Django, see the tigris-python-sdk skill.
Use when backing up databases to Tigris, scheduling exports, archiving data, or setting up automated backup pipelines — covers Next.js, Remix, Rails, Django, Laravel, Express
Use when working with Tigris from Python — boto3 setup, Django uploads via django-storages, snapshots, bucket forking, in-place object rename, conditional writes (IfMatch/IfNoneMatch), and the Bundle API for batch ML data fetches. Covers the tigris-boto3-ext extension library (context managers, decorators, helpers) plus framework integration.
Use when choosing between Tigris-native SDKs and AWS S3-compatible SDKs — covers which SDK to use per language, CLI preference, and when AWS SDKs are the only option
| name | tigris-lifecycle-management |
| description | Use when setting up automatic object expiration, storage tier transitions, TTL-based deletion, or cleanup rules for Tigris buckets |
Automate object expiration, storage tier transitions, and cleanup with lifecycle rules. Set policies that automatically delete temporary files, archive old data, and control storage costs.
Before doing anything else, install the Tigris CLI if it's not already available:
tigris help || npm install -g @tigrisdata/cli
If you need to install it, tell the user: "I'm installing the Tigris CLI (@tigrisdata/cli) so we can work with Tigris object storage."
| Operation | Command |
|---|---|
| Set rules | tigris buckets lifecycle set <bucket> --config lifecycle.json |
| View rules | tigris buckets lifecycle get <bucket> |
| Remove rules | tigris buckets lifecycle delete <bucket> |
tigris buckets lifecycle set my-app-uploads --config lifecycle.json
{
"Rules": [
{
"ID": "rule-name",
"Filter": { "Prefix": "path/prefix/" },
"Status": "Enabled",
"Expiration": { "Days": 30 },
"Transitions": [
{ "Days": 7, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
]
}
]
}
| Field | Purpose |
|---|---|
ID | Human-readable rule name |
Filter.Prefix | Only apply to objects matching this prefix |
Status | "Enabled" or "Disabled" |
Expiration.Days | Delete objects after N days |
Transitions | Move objects between storage tiers |
Delete files in tmp/ after 24 hours:
{
"Rules": [
{
"ID": "cleanup-temp-uploads",
"Filter": { "Prefix": "tmp/" },
"Status": "Enabled",
"Expiration": { "Days": 1 }
}
]
}
Delete unprocessed uploads after 7 days:
{
"Rules": [
{
"ID": "expire-unverified-uploads",
"Filter": { "Prefix": "uploads/pending/" },
"Status": "Enabled",
"Expiration": { "Days": 7 }
}
]
}
Auto-delete session files after 1 day:
{
"Rules": [
{
"ID": "cleanup-sessions",
"Filter": { "Prefix": "sessions/" },
"Status": "Enabled",
"Expiration": { "Days": 1 }
}
]
}
Move logs to cheaper storage, then delete after 1 year:
{
"Rules": [
{
"ID": "archive-logs",
"Filter": { "Prefix": "logs/" },
"Status": "Enabled",
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}
]
}
Keep backups for 30 days:
{
"Rules": [
{
"ID": "expire-old-backups",
"Filter": { "Prefix": "backups/" },
"Status": "Enabled",
"Expiration": { "Days": 30 }
}
]
}
Clean up old build artifacts:
{
"Rules": [
{
"ID": "cleanup-old-builds",
"Filter": { "Prefix": "builds/" },
"Status": "Enabled",
"Expiration": { "Days": 14 }
}
]
}
| Tier | Cost | Access | Use For |
|---|---|---|---|
STANDARD | Highest | Instant | Frequently accessed files |
STANDARD_IA | Lower | Instant, retrieval fee | Infrequent access (>30 days old) |
GLACIER | Lowest | Minutes-hours retrieval | Archives, compliance (>90 days old) |
| Scenario | Transition At | Save |
|---|---|---|
| User uploads rarely re-accessed | 30 days → IA | ~40% storage cost |
| Compliance archives | 90 days → Glacier | ~80% storage cost |
| Build artifacts | 7 days → IA, 30 days → delete | ~90% with deletion |
Combine rules for a complete lifecycle policy:
{
"Rules": [
{
"ID": "cleanup-temp",
"Filter": { "Prefix": "tmp/" },
"Status": "Enabled",
"Expiration": { "Days": 1 }
},
{
"ID": "archive-uploads",
"Filter": { "Prefix": "uploads/" },
"Status": "Enabled",
"Transitions": [
{ "Days": 90, "StorageClass": "STANDARD_IA" }
]
},
{
"ID": "expire-backups",
"Filter": { "Prefix": "backups/" },
"Status": "Enabled",
"Expiration": { "Days": 30 }
},
{
"ID": "archive-logs",
"Filter": { "Prefix": "logs/" },
"Status": "Enabled",
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}
]
}
When lifecycle rules aren't granular enough (e.g., expiration based on metadata, not age), implement TTL in your application:
import { put, list, remove, head } from "@tigrisdata/storage";
// Store with expiration metadata
await put("tokens/abc123.json", data, {
contentType: "application/json",
// Store expiry as part of the key or track in your database
});
// Cleanup job: delete expired objects
async function cleanupExpired(prefix: string, maxAgeMs: number) {
const result = await list({ prefix });
const now = Date.now();
for (const item of result.data?.items ?? []) {
const age = now - new Date(item.modified).getTime();
if (age > maxAgeMs) {
await remove(item.path);
}
}
}
// Run daily
cleanupExpired("tokens/", 24 * 60 * 60 * 1000); // 24 hours
Always: Use lifecycle rules for predictable cleanup patterns | Set expiration on temporary/transient data | Use storage tier transitions for cost savings | Test rules on a non-production bucket first
Never: Rely solely on lifecycle for critical data deletion (add application-level checks) | Set short expiration on buckets with important data without backups | Forget that deleted objects are gone permanently (unless you have snapshots)