← 返回 Skills 市场
Agent State Backup
作者
benxiao2026
· GitHub ↗
· v1.0.0
· MIT-0
169
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-state-backup
功能描述
Auto-backs up core files (IDENTITY, SOUL, MEMORY, knowledge base) daily via cron, creates compressed .tgz archive, enables one-click restore in new environme...
使用说明 (SKILL.md)
Agent State Backup & Restore
自动备份 OpenClaw 核心状态文件,防止上下文丢失。
📦 备份内容
IDENTITY.md- 身份定义SOUL.md- 人格定义MEMORY.md- 长期记忆memory/*.md- 每日记忆USER.md- 用户信息knowledge/**/*- 知识库
🚀 快速使用
手动备份
~/.openclaw/workspace/scripts/agent-backup.sh
手动恢复
~/.openclaw/workspace/scripts/agent-restore.sh
设置自动备份 (每日凌晨 2 点)
~/.openclaw/workspace/scripts/setup-backup-cron.sh
📁 文件位置
- 备份脚本:
~/.openclaw/workspace/scripts/agent-backup.sh - 恢复脚本:
~/.openclaw/workspace/scripts/agent-restore.sh - 备份目录:
~/.openclaw/backups/ - 保留策略: 最近 7 个备份
🔧 配置选项
编辑 ~/.openclaw/workspace/scripts/agent-backup.sh:
# 修改保留天数 (默认 7 天)
ls -t agent_backup_*.tgz | tail -n +8 | xargs -r rm
# 改为保留 30 天:tail -n +31
# 修改备份目录
BACKUP_DIR="$HOME/.openclaw/backups"
📊 备份日志
查看备份历史:
cat ~/.openclaw/backups/backup.log
⚠️ 注意事项
- 首次备份前 - 确保所有重要文件已保存
- 恢复操作 - 会覆盖当前文件,建议先备份当前状态
- 磁盘空间 - 每个备份约 20-50KB,7 个备份约 350KB
- Cron 权限 - 确保 cron 有权限访问工作目录
🔄 迁移到新环境
- 在新环境安装 OpenClaw
- 复制备份文件
.tgz到新机器 - 运行
agent-restore.sh - 重启 OpenClaw
版本: 1.0.0
最后更新: 2026-03-03
依赖: bash, tar, gzip
安全使用建议
This skill's documentation describes convenient backup/restore scripts and cron setup, but the package contains only instructions (no scripts or installer). Before installing or following the steps: 1) Do not copy/run commands that assume scripts exist — obtain the actual scripts from a trusted source or implement them yourself. 2) Review any backup/restore scripts you run to ensure deletion commands (xargs rm) use the correct paths and safeguards to avoid accidental deletions. 3) Treat backups as highly sensitive: encrypt them, restrict filesystem permissions, and use secure transfer methods when migrating to another machine. 4) If you expect an automated "one‑click" restore, confirm the skill actually supplies the needed scripts or an installer; otherwise this package is incomplete. 5) Prefer testing restore on a disposable environment before overwriting production data.
功能分析
Type: OpenClaw Skill
Name: agent-state-backup
Version: 1.0.0
The skill bundle contains metadata and documentation for a legitimate utility designed to back up and restore OpenClaw agent state files (identity, memory, and knowledge base). The instructions in SKILL.md describe standard administrative tasks using common tools like tar, gzip, and cron for local data preservation. No evidence of data exfiltration, malicious code execution, or deceptive prompt injection was found in the provided files (_meta.json and SKILL.md).
能力评估
Purpose & Capability
The described purpose (backup/restore of OpenClaw state files) is coherent with the files and paths referenced (~/.openclaw/*). However the skill promises runnable scripts (agent-backup.sh, agent-restore.sh, setup-backup-cron.sh) and a "one-click restore" experience while the package is instruction-only and contains no code or install spec — the claimed capabilities are not actually provided.
Instruction Scope
SKILL.md instructs the agent/user to run scripts that would read/write/overwrite sensitive local files, set up cron jobs, and delete old backups (e.g., using xargs rm). Those actions are within the stated backup scope, but the instructions assume the presence of scripts that don't exist here and include deletion commands that can be dangerous if run in the wrong directory or without verification.
Install Mechanism
There is no install spec and no code files (instruction-only). That lowers risk of arbitrary code being installed, but it also means the skill is incomplete: it documents scripts and dependencies (bash, tar, gzip) but does not provide them or an installation mechanism to create them.
Credentials
The skill requests no environment variables or credentials, which is proportionate. However the backups themselves contain highly sensitive state (IDENTITY, SOUL, MEMORY, USER.md, knowledge) — the SKILL.md does not mention encryption or secure storage/transfer, which is important for proportional handling of sensitive data.
Persistence & Privilege
The skill does not request always:true and uses normal autonomous invocation defaults. There is no evidence it modifies other skills or system-wide configs. If the agent were allowed to run the described scripts autonomously, it could access and overwrite sensitive files — but the package does not include those scripts.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-state-backup - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-state-backup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of agent-state-backup.
- Provides daily automatic backup for core agent files (IDENTITY, SOUL, MEMORY, knowledge base) via cron.
- Backs up files as compressed .tgz archives and retains the latest 7 backups by default.
- Includes scripts for one-click manual backup and restore.
- Enables easy migration or recovery to prevent context loss after restarts or environment changes.
元数据
常见问题
Agent State Backup 是什么?
Auto-backs up core files (IDENTITY, SOUL, MEMORY, knowledge base) daily via cron, creates compressed .tgz archive, enables one-click restore in new environme... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 169 次。
如何安装 Agent State Backup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-state-backup」即可一键安装,无需额外配置。
Agent State Backup 是免费的吗?
是的,Agent State Backup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent State Backup 支持哪些平台?
Agent State Backup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent State Backup?
由 benxiao2026(@benxiao2026)开发并维护,当前版本 v1.0.0。
推荐 Skills