ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Continuous Openclaw Config Guard

Skill by cxlhyx

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/cxlhyx/continuous-openclaw-config-guard
Or

name: continuous-openclaw-config-guard description: OpenClaw configuration rollback guardian with automatic backup and recovery. Monitors openclaw.json for changes, creates backups before modifications, restarts the gateway, and automatically rolls back if no message activity is detected within a configurable timeout (default 5 minutes). Provides safety net for risky configuration changes, gateway configuration testing, or any edits to openclaw.json that might break the system. Use when: (1) Editing openclaw.json and want automatic rollback protection, (2) Testing new gateway configurations safely, (3) Need automatic backup before config changes, (4) Want peace of mind when modifying OpenClaw settings.


OpenClaw 配置回滚守护

适用且测试过linux系统。

功能

  1. 监控配置文件 - 持续监控 ~/.openclaw/openclaw.json
  2. 自动备份 - 配置修改前自动创建备份
  3. 自动重启网关 - 配置修改后自动重启网关
  4. 消息验证 - 一段时间内未收到消息则自动回滚
  5. 自动恢复 - 回滚后自动重启网关

文件结构

~/.openclaw/workspace/skills/continuous-openclaw-config-guard/
├── scripts/
    ├── guard.sh                          # 守护脚本(核心)
    └── continuous-openclaw-config-guard.service.txt     # systemd 服务文件
├── SKILL.md                         # 本说明文件
├── guard.log                         # 运行日志
├── guard.pid                         # 进程ID文件
└── backups/                          # 备份目录
    ├── openclaw.json.20250310160000
    ├── openclaw.json.20250310160500
    └── openclaw.json.rollback.20250310161000

环境变量

可以通过环境变量自定义配置。

必须修改的变量

变量默认值说明为什么需要修改
SESSION_FILE~/.openclaw/agents/huoxiaoxing/sessions/sessions.json会话文件路径必须修改! 默认值中的 huoxiaoxing 是开发者的 agent 名称,其他用户需要改成自己的 agent 名称才能正确检测消息活动

通常不需要修改的变量

如果你的 OpenClaw 安装路径或者agent的工作空间不同,需要修改以下变量。

变量默认值说明
CONFIG_FILE~/.openclaw/openclaw.json要监控的配置文件
BACKUP_DIR~/.openclaw/workspace/skills/continuous-openclaw-config-guard/backups备份存放目录
LOG_FILE~/.openclaw/workspace/skills/continuous-openclaw-config-guard/guard.log日志文件路径
PID_FILE~/.openclaw/workspace/skills/continuous-openclaw-config-guard/guard.pidPID文件路径
OPENCLAW_BIN~/.npm-global/bin/openclawOpenClaw 可执行文件
WAIT_TIME300等待验证时间(秒)
CHECK_INTERVAL10检查间隔(秒)

使用环境变量示例

Metadata

Author@cxlhyx
Stars3409
Views1
Updated2026-03-25
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-cxlhyx-continuous-openclaw-config-guard": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.