← 返回 Skills 市场
flyingtimes

backup claw

作者 flyingtimes · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
229
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install backupclaw
功能描述
Backup and restore OpenClaw configuration files. Use when the user wants to backup ~/.openclaw/ configuration (excluding workspace) to a date-stamped directo...
使用说明 (SKILL.md)

Backupclaw

Overview

Full backup and restore capability for OpenClaw configuration files. Backups are stored in date-stamped directories (YYYY-MM-DD format). Only performs backup when configuration has actually changed.

Core Operations

0. Backup Directory Management (NEW)

Configuration file:

  • Location: ~/.openclaw/backup.json
  • Format:
    {
      "backup_location": "/path/to/backup/directory"
    }
    

Get backup directory:

  1. Check if ~/.openclaw/backup.json exists
  2. If exists, read "backup_location" field
  3. If missing or file doesn't exist:
    • Ask user for backup directory path
    • Create ~/.openclaw/backup.json with the provided path
    • Confirm path to user

Change backup directory (changedir command): When user runs backupclaw changedir \x3Cnew_path>:

  1. Validate new path exists and is writable
  2. Update ~/.openclaw/backup.json with new path
  3. Inform user of successful change

Example changedir usage:

  • "backupclaw changedir ~/backups/openclaw"
  • "修改备份目录到 /mnt/backup/openclaw"

1. Backup Configuration

Backup directory setup:

  • Get backup directory using the management flow above (Section 0)
  • No longer store in TOOLS.md; use backup.json instead

Backup process:

  1. Generate current date string in YYYY-MM-DD format
  2. If backup directory has no previous backups:
    • Copy all files from ~/.openclaw/ to $backup_claw_dir/YYYY-MM-DD/, excluding workspace/
    • Record initial backup in changelog
  3. If previous backups exist:
    • Find the most recent backup directory (latest date)
    • Compare files between latest backup and current ~/.openclaw/ using diff
    • If no changes detected: Tell user "配置文件没有变化,不需要备份"
    • If changes detected:
      • Create new date-stamped directory
      • Copy all files from ~/.openclaw/ to new directory, excluding workspace/
      • Update changelog with list of modified files
      • Report changes to user

Changelog format:

  • Located at $backup_claw_dir/changelog.md
  • Each entry includes date, time, and list of changed files
  • Format example:
    ## 2026-03-12 14:30:00
    - openclaw.json (modified)
    - extensions/feishu/skills/feishu-doc/SKILL.md (added)
    

Exclusion rules:

  • Always exclude workspace/ directory from backup
  • Preserve directory structure for all other files

2. Restore Configuration

Restore process:

  1. Accept date parameter in YYYY-MM-DD format
  2. Verify backup directory exists at $backup_claw_dir/YYYY-MM-DD/
  3. If backup not found, inform user and list available dates
  4. If backup found:
    • Warn user about overwriting current configuration
    • Confirm before proceeding
    • Restore files from backup to ~/.openclaw/
    • Exclude workspace/ from restoration
    • Report success and list restored files

Usage Examples

Typical user requests that trigger this skill:

  • "backup my openclaw config"
  • "restore openclaw backup from 2026-03-12"
  • "check if config changed"
  • "备份 openclaw 配置"
  • "恢复 2026-03-12 的备份"
  • "backupclaw changedir ~/backups/openclaw"
  • "修改备份目录" (prompts for new path)

Implementation Notes

Tools to use:

  • rsync or cp -r for copying files
  • diff for comparing file contents
  • find with sort and tail to find latest backup
  • Date command: date +%Y-%m-%d
  • read and write tools for managing ~/.openclaw/backup.json

Backup directory management:

  • Always check ~/.openclaw/backup.json first before asking user
  • Only prompt for backup path if backup_location is not set
  • Validate directory exists and is writable before saving
  • Use write tool to create/update backup.json

changedir command handling:

  • Parse command format: backupclaw changedir \x3Cpath> or equivalent Chinese phrasing
  • Validate new directory exists and is writable (create if doesn't exist, ask first)
  • Update backup.json with new path
  • Confirm successful change to user

Backup directory structure:

$backup_claw_dir/
├── 2026-03-12/
│   ├── openclaw.json
│   ├── agents/
│   ├── extensions/
│   └── ...
├── 2026-03-13/
│   └── ...
└── changelog.md

Error handling:

  • Always verify backup directory exists and is writable before proceeding
  • Check for sufficient disk space
  • Validate date format for restore operation
  • Provide clear error messages in Chinese when appropriate
安全使用建议
This skill appears coherent and does what it says: local backup/restore of ~/.openclaw/ excluding workspace. Before installing or running it, make sure: (1) the host has the required CLI tools (rsync, diff, find, date) since they are used but not declared; (2) you pick a safe, writable backup directory (the script will store that path in ~/.openclaw/backup.json); (3) you review the scripts if you have files with unusual names (spaces/newlines) because simple diff parsing can mis-handle edge cases; and (4) run the scripts interactively (they prompt for confirmation on restore) rather than granting them blanket autonomous execution. No network exfiltration, credential access, or other suspicious behavior was found.
功能分析
Type: OpenClaw Skill Name: backupclaw Version: 1.0.0 The backupclaw skill is a legitimate utility for managing OpenClaw configuration backups. It uses standard system tools like rsync, diff, and find to create date-stamped backups of ~/.openclaw/ (excluding the workspace directory) and provides a restore mechanism. The scripts (backup.sh and restore.sh) follow the logic described in SKILL.md, and no evidence of data exfiltration, malicious execution, or prompt-injection attacks was found.
能力评估
Purpose & Capability
The name/description, SKILL.md, and the two included shell scripts all focus on backing up and restoring ~/.openclaw/ (excluding workspace) to a date-stamped directory and recording a changelog. The required actions (copy, diff, directory management) are consistent with the stated purpose.
Instruction Scope
Runtime instructions and the scripts only read/write local paths (~/.openclaw and the user-provided backup directory) and prompt the user before destructive actions. There are no instructions to read unrelated system paths, exfiltrate data, or send data to external endpoints. The SKILL.md does reference common CLI tools (rsync, diff, find, date) which are used by the scripts.
Install Mechanism
There is no install spec (instruction-only) and the skill ships two bash scripts. This is low-risk. One minor inconsistency: the registry metadata lists no required binaries, yet SKILL.md and the scripts expect rsync, diff, find, date, and standard shell utilities. The skill does not supply or declare installation of those tools.
Credentials
No credentials or environment variables are requested. The scripts use $HOME implicitly for ~/.openclaw and accept the backup root directory as an explicit parameter; this is proportionate to the task.
Persistence & Privilege
always is false and the skill does not request permanent presence or modify other skills or global agent configuration. It prompts for confirmation before overwriting configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install backupclaw
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /backupclaw 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of backupclaw: backup and restore OpenClaw configuration files. - Backs up `~/.openclaw/` (excluding `workspace/`) to a user-specified, date-stamped directory, with diff-based change detection. - Manages backup directory via `~/.openclaw/backup.json`; prompts user if not set. - Allows backup directory change with the `backupclaw changedir <path>` command. - Maintains a changelog of changes in `changelog.md`. - Supports restoring configuration from any backup date. - Provides clear error handling and multilingual prompts.
元数据
Slug backupclaw
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

backup claw 是什么?

Backup and restore OpenClaw configuration files. Use when the user wants to backup ~/.openclaw/ configuration (excluding workspace) to a date-stamped directo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 229 次。

如何安装 backup claw?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install backupclaw」即可一键安装,无需额外配置。

backup claw 是免费的吗?

是的,backup claw 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

backup claw 支持哪些平台?

backup claw 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 backup claw?

由 flyingtimes(@flyingtimes)开发并维护,当前版本 v1.0.0。

💬 留言讨论