openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > OpenClaw State Backup

Create, inspect, and restore versioned OpenClaw state backups with rollback safety. Use when backing up or migrating OpenClaw memory, workspace state, gatewa...

系统与自动化

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.2

统计:⭐ 0 · 143 · 0 current installs · 0 all-time installs

0

安装量(当前) 0

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:danielwangyy/openclaw-state-backup

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill generally matches its stated purpose (filesystem backup/restore of OpenClaw state) but the shipped code has bugs, incomplete/truncated content, and the tool will archive potentially sensitive local files in unencrypted .tar.gz archives — you should inspect and test before trusting it for production restores.

目的

Name/description match the included scripts and instructions. The scripts enumerate and archive OpenClaw runtime and workspace paths (state dir and workspace), build a manifest, compute checksums, and provide restore/dry-run behavior — all consistent with a state backup/restore tool.

说明范围

SKILL.md restricts behavior to creating/verifying/restoring archives and describes safety rules. The scripts read/write files under the user's home and workspace (e.g., ~/.openclaw, workspace/*, workspace/skills/). This is expected for a backup tool, but means backups may include sensitive user data and local skill code. No network exfiltration or unexpected external endpoints are present in the instructions or code.

安装机制

Instruction-only with included Python scripts; no install spec, no external downloads, and no package install steps. This is the lowest install risk and aligns with the skill's purpose.

证书

The skill requests no environment variables or credentials, and only accesses local filesystem and basic system info (hostname, platform). That access is appropriate for a backup/restore tool, but the set of files it copies (including workspace/skills/) can contain secrets; archives are produced unencrypted, so secure handling of generated archives is necessary.

持久

Skill is not always-enabled and does not request elevated persistence. It does create rollback archives and write reports to disk (expected behavior). It does not attempt to change other skills' configs or system-wide settings.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「OpenClaw State Backup」。简介:Create, inspect, and restore versioned OpenClaw state backups with rollback saf…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/danielwangyy/openclaw-state-backup/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: openclaw-state-backup
version: 1.0.2
description: Create, inspect, and restore versioned OpenClaw state backups with rollback safety. Use when backing up or migrating OpenClaw memory, workspace state, gateway config, cron/session state, or when restoring a previously captured snapshot after breakage, config mistakes, host migration, or context-loss concerns.
---

# OpenClaw State Backup

Create and restore **versioned, restorable snapshots** of mutable OpenClaw state.

## What changes over time

Treat these as **mutable state** and include them in backups when they exist:

- `~/.openclaw/openclaw.json` — runtime config
- `~/.openclaw/sessions.json` — session metadata
- `~/.openclaw/restart-sentinel.json` — recent restart delivery state
- `~/.openclaw/memory/` — vector index / memory DBs
- `~/.openclaw/agents/` — per-agent runtime/session state
- `workspace/MEMORY.md`
- `workspace/memory/`
- `workspace/SESSION-STATE.md`
- `workspace/HEARTBEAT.md`
- `workspace/TOOLS.md`
- `workspace/skills/` — user-authored skills and local skill state

Treat these as **mostly static/user-maintained bootstrap files** and back them up when you want a full environment restore, but do not rely on them as fast-changing runtime state:

- `workspace/SOUL.md`
- `workspace/USER.md`
- `workspace/IDENTITY.md`
- `workspace/AGENTS.md`
- `workspace/BOOTSTRAP.md` (if still present)

## Backup strategy

Use the bundled scripts for deterministic behavior.

### Create backup

Run `scripts/backup_state.py` with:

- `--workspace <path>`
- `--state-dir <path>` (usually `~/.openclaw`)
- `--output-dir <path>` for generated snapshots
- optional `--label <name>`
- optional `--mode mutable|full` (default: `mutable`)
- optional repeated `--include-prefix <relative-path-prefix>`
- optional repeated `--exclude-prefix <relative-path-prefix>`

`mutable` captures changing state only.
`full` adds mostly-static workspace identity/bootstrap files too.

The script writes:

- a timestamped `.tar.gz`
- a `manifest.json`
- checksums for every stored file
- compatibility metadata (`formatVersion`, OpenClaw version, host/platform)
- applied include/exclude filter metadata

### Restore backup

Run `scripts/restore_state.py` with:

- `--archive <path-to-tar.gz>`
- `--workspace <path>`
- `--state-dir <path>`
- optional `--verify-only`
- optional `--dry-run`
- optional `--allow-version-mismatch`
- optional `--report-dir <path>`
- optional repeated `--include-prefix <relative-path-prefix>`
- optional repeated `--exclude-prefix <relative-path-prefix>`

Restore behavior:

1. verify archive structure + checksums
2. compare compatibility metadata
3. optionally narrow restore scope with include/exclude prefixes
4. build a restore plan (`create` / `update` / `unchanged` / `missingFromArchive`)
5. always write a JSON restore/dry-run report to disk
6. if `--dry-run`, stop after writing the diff-style report
7. otherwise create a **pre-restore rollback backup** automatically
8. restore files into place
9. write a final restore report showing what changed and where rollback lives

## Safety rules

- Always prefer `--verify-only` first when archive provenance is uncertain.
- Never overwrite from an archive that fails checksum verification.
- Never delete unrelated files outside the managed backup manifest.
- If compatibility check fails, stop unless the user explicitly wants `--allow-version-mismatch`.
- Before reporting restore success, mention the generated rollback archive path.

## File model

The scripts split backup contents into:

- `mutable/` — runtime-changing state
- `static/` — mostly-stable workspace identity/configuration files
- `meta/manifest.json` — archive manifest

Read the manifest if you need to inspect contents without restoring.

## When to use which mode

- Use **mutable** for routine safety snapshots and frequent backups.
- Use **full** before machine migration, risky reconfiguration, or major cleanup.

## Recovery guidance

If a restore causes problems, immediately restore the auto-generated **pre-restore rollback archive** created by `restore_state.py`.