返回顶部
d

disk-cleanup

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
103
下载量
0
收藏
概述
安装方式
版本历史

disk-cleanup

# Disk Cleanup Automated disk space recovery for OpenClaw deployments. Covers 12 cleanup categories that OpenClaw does not handle natively (as of 2026.3.13). ## What OpenClaw Already Handles (skip these) - **Session store**: `session.maintenance` config (pruneAfter, maxEntries, rotateBytes) - **Sandbox containers**: `sandbox.prune` config (idleHours, maxAgeDays) - **Context pruning**: `contextPruning` config (cache-ttl mode) ## What This Skill Handles (the gaps) | # | Category | Typical Growth | Trigger | |---|----------|---------------|---------| | 1 | Memory SQLite `.tmp-*` orphans | Hundreds of MB from failed reindex | Always | | 2 | Memory SQLite VACUUM | Fragmentation after heavy use | `--aggressive` | | 3 | Docker images/volumes/build cache | GB from sandbox rebuilds | Always | | 4 | Gateway logs (`/tmp/openclaw/*.log`) | Grows daily | >3 days old | | 5 | `/tmp` OpenClaw temp files | Patrol/board/cron artifacts | >24h old | | 6 | Workspace `.prebind.*` backups | Hundreds of MB per backup | >7 days old | | 7 | Delivery queue old entries | Grows with message volume | >7 days old | | 8 | systemd journal | GB on default VPS configs | >500MB | | 9 | npm/yarn/pnpm/bun/prisma/node-gyp cache | GB from skill/plugin installs | >100MB | | 10 | Rotated syslogs + btmp | SSH brute-force logs on public VPS | Always | | 11 | Git workspace `.git` | Auto-commit growth (board-move etc.) | >200MB | | 12 | QMD/migration artifacts | Stale after backend switch | Auto-detected | ## Quick Start Run directly: ```bash # Preview what would be cleaned (safe, no deletions) bash scripts/disk-cleanup.sh --dry-run # Normal cleanup bash scripts/disk-cleanup.sh # Deep cleanup: includes SQLite VACUUM + aggressive git gc bash scripts/disk-cleanup.sh --aggressive # Cron mode: only outputs summary line bash scripts/disk-cleanup.sh --quiet ``` ## Schedule as Cron Job Weekly Sunday 04:00 CET (recommended): ``` Use the cron tool: schedule: { kind: "cron", expr: "0 3 * * 0", tz: "Europe/Luxembourg" } payload: { kind: "agentTurn", message: "Run disk cleanup: bash scripts/disk-cleanup.sh --aggressive --quiet. Report results." } sessionTarget: "isolated" ``` Or integrate into an existing infra-health-check script by adding a disk usage threshold trigger: ```bash DISK_PCT=$(df / --output=pcent | tail -1 | tr -d ' %') if [ "$DISK_PCT" -ge 85 ]; then bash /path/to/disk-cleanup.sh --quiet fi if [ "$DISK_PCT" -ge 90 ]; then bash /path/to/disk-cleanup.sh --aggressive --quiet fi ``` ## Environment Variables | Variable | Default | Description | |----------|---------|-------------| | `OPENCLAW_HOME` | `~/.openclaw` | OpenClaw state directory | | `OPENCLAW_WORKSPACE` | `$(pwd)` | Agent workspace root | ## Exit Codes - `0` — Success (cleaned or nothing to clean) - `1` — Error during cleanup ## Output Format Last line is machine-parseable: ``` CLEAN|0|0B|44% # Nothing cleaned CLEANED|5|1.2GB|67% # 5 actions, freed 1.2GB, now at 67% ``` ## Safety - `--dry-run` previews all actions without deleting - SQLite VACUUM only on `--aggressive` and only when fragmentation ≥5% - Docker prune only removes dangling (untagged) images; named images are safe - btmp is truncated (not deleted) — system expects the file to exist - Journal vacuum installs a persistent 500MB limit to prevent regrowth - Git gc uses `--auto` by default; `--aggressive` only with flag

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 disk-cleanup-1776029422 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 disk-cleanup-1776029422 技能

通过命令行安装

skillhub install disk-cleanup-1776029422

下载 Zip 包

⬇ 下载 disk-cleanup v1.0.0

文件大小: 8.57 KB | 发布时间: 2026-4-13 10:03

v1.0.0 最新 2026-4-13 10:03
Initial release: 12-category automated disk cleanup for OpenClaw deployments. Tested: recovered 17GB (89%→44%) on production VPS.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部