Continuous Openclaw Config Guard
Skill by cxlhyx
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cxlhyx/continuous-openclaw-config-guardname: 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系统。
功能
- 监控配置文件 - 持续监控
~/.openclaw/openclaw.json - 自动备份 - 配置修改前自动创建备份
- 自动重启网关 - 配置修改后自动重启网关
- 消息验证 - 一段时间内未收到消息则自动回滚
- 自动恢复 - 回滚后自动重启网关
文件结构
~/.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.pid | PID文件路径 |
OPENCLAW_BIN | ~/.npm-global/bin/openclaw | OpenClaw 可执行文件 |
WAIT_TIME | 300 | 等待验证时间(秒) |
CHECK_INTERVAL | 10 | 检查间隔(秒) |
使用环境变量示例
Metadata
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cxlhyx-continuous-openclaw-config-guard": {
"enabled": true,
"auto_update": true
}
}
}