Files
nexus/openclaw/openclaw定时任务.md
2026-03-23 20:57:45 +08:00

132 lines
4.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpenClaw 定时任务
## 任务列表
### OpenClaw Cron Jobs (星辉 Agent)
| 序号 | 任务名称 | 执行时间 | 状态 | 说明 |
|------|----------|----------|------|------|
| 1 | 每日备份任务 | 每天 22:00 | ⚠️ 错误 | 需要配置 delivery.channel |
| 2 | 每日定时任务检查 | 每天 09:00 | ⚠️ 错误 | 正在执行中 |
### macOS LaunchAgents
| 序号 | 任务名称 | 执行时间 | 状态 | 说明 |
|------|----------|----------|------|------|
| 1 | ai.openclaw.gateway | 开机自启 | ✅ 运行中 | OpenClaw Gateway 服务 |
| 2 | com.openclaw.logcleaner | 每天 03:00 | ✅ 启用 | 清理 7 天前的日志 |
### Ubuntu2 Crontabs
| 序号 | 任务名称 | 执行时间 | 状态 | 说明 |
|------|----------|----------|------|------|
| - | 无 | - | - | Ubuntu2 上暂无定时任务 |
---
## 任务详情
### 1. 每日备份任务 (OpenClaw Cron)
- **类型**: OpenClaw Cron Job
- **执行时间**: 每天 22:00 (cron: 0 22 * * *)
- **执行内容**:
- Mac Mini 备份:`~/.openclaw/scripts/backup-openclaw.sh macmini`
- Ubuntu2 备份:`ssh ubuntu2 "~/.openclaw/scripts/backup-openclaw.sh ubuntu2"`
- 更新备份状态笔记
- **下次执行**: 2026-03-19 22:00
### 2. ai.openclaw.gateway (LaunchAgent)
- **类型**: macOS LaunchAgent
- **执行时间**: 开机自启
- **执行内容**: 启动 OpenClaw Gateway 服务
- **端口**: 18789
- **日志**: ~/.openclaw/logs/gateway.log
### 3. com.openclaw.logcleaner (LaunchAgent)
- **类型**: macOS LaunchAgent
- **执行时间**: 每天 03:00
- **执行内容**: 清理 /tmp/openclaw 目录下 7 天前的日志
---
## 执行状态记录
### 2026-03-19
| 任务 | 执行时间 | 状态 | 结果 |
|------|----------|------|------|
| 每日定时任务检查 | 09:00 | ⚠️ 执行中 | 检查完成 |
### 2026-03-18
| 任务 | 执行时间 | 状态 | 结果 |
|------|----------|------|------|
| 每日定时任务检查 | 09:00 | ✅ 已执行 | 检查完成 |
| 每日备份任务 | 22:00 | ❌ 失败 | Channel is required |
### 2026-03-17
| 任务 | 执行时间 | 状态 | 结果 |
|------|----------|------|------|
| 每日备份任务 | 22:00 | ❌ 失败 | Delivering to Telegram requires target |
| 每日定时任务检查 | 09:00 | ✅ 已执行 | 演练检查 |
### 2026-03-19 09:00 检查结果
#### OpenClaw Cron Jobs
| 序号 | 任务名称 | 状态 | 下次执行 | 上次执行 | 备注 |
| --- | -------- | -------------- | ---------------- | ------------------------ | ------------ |
| 1 | 每日定时任务检查 | ⚠️ error (运行中) | 2026-03-20 09:00 | 2026-03-18 09:00 (error) | 需要排查 |
| 2 | 每日备份任务 | ⚠️ error | 2026-03-19 22:00 | 2026-03-18 22:00 (error) | 需要配置 channel |
> ⚠️ 两个 OpenClaw Cron Job 都显示 error 状态,需要修复 delivery 配置
#### macOS LaunchAgents
| 序号 | 任务名称 | PID | 状态 |
|------|----------|-----|------|
| 1 | ai.openclaw.gateway | 46442 | ✅ 运行中 |
| 2 | com.openclaw.logcleaner | - | ✅ 启用 |
> com.openclaw.logcleaner 显示 PID 0可能是残留进程
#### Ubuntu2 Crontabs
- 无定时任务
---
### 2026-03-18 09:00 检查结果
#### OpenClaw Cron Jobs
| 序号 | 任务名称 | 状态 | 下次执行 | 上次执行 |
|------|----------|------|----------|----------|
| 1 | 每日定时任务检查 | ✅ 启用 | 2026-03-19 09:00 | 刚刚执行 |
| 2 | 每日备份任务 | ✅ 启用 | 2026-03-18 22:00 | 2026-03-17 22:00 (❌ 失败) |
> ⚠️ 每日备份任务上次执行失败,错误信息: "Delivering to Telegram requires target <chatId>"
#### macOS LaunchAgents
| 序号 | 任务名称 | PID | 状态 |
|------|----------|-----|------|
| 1 | ai.openclaw.gateway | 51502 | ✅ 运行中 |
| 2 | com.openclaw.logcleaner | - | ✅ 启用 (未运行) |
#### Ubuntu2 Crontabs
- 无定时任务
### 2026-03-17 12:30 检查结果
#### OpenClaw Cron Jobs
| 序号 | 任务名称 | 状态 | 下次执行 |
|------|----------|------|----------|
| 1 | 每日备份任务 | ✅ 启用 | 2026-03-17 22:00 |
| 2 | 每日定时任务检查 | ✅ 启用 | 2026-03-18 09:00 |
#### macOS LaunchAgents
| 序号 | 任务名称 | PID | 状态 |
|------|----------|-----|------|
| 1 | ai.openclaw.gateway | 24339 | ✅ 运行中 |
| 2 | com.openclaw.logcleaner | - | ✅ 启用 |
#### Ubuntu2 Crontabs
- 无定时任务