Auto backup before evolver run - 2026年 03月 10日 星期二 19:00:50 CST

This commit is contained in:
2026-03-10 19:00:50 +08:00
parent c69fcd1ace
commit 803bf3a6b6
101 changed files with 15557 additions and 868 deletions
+45 -31
View File
@@ -7,7 +7,7 @@
"name": "backup-openclaw-json",
"enabled": true,
"createdAtMs": 1772261581796,
"updatedAtMs": 1772996418023,
"updatedAtMs": 1773082825569,
"schedule": {
"kind": "cron",
"expr": "0 3 * * *",
@@ -23,10 +23,10 @@
"mode": "announce"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996400005,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082800006,
"lastStatus": "ok",
"lastDurationMs": 18018,
"lastDurationMs": 25563,
"consecutiveErrors": 0,
"lastRunStatus": "ok",
"lastDelivered": true,
@@ -39,7 +39,7 @@
"name": "capability-evolver-daily",
"enabled": true,
"createdAtMs": 1772550743528,
"updatedAtMs": 1772967715777,
"updatedAtMs": 1773054077606,
"schedule": {
"kind": "cron",
"expr": "0 19 * * *",
@@ -60,16 +60,15 @@
"to": "feishu-pm"
},
"state": {
"nextRunAtMs": 1773054000000,
"lastRunAtMs": 1772967600004,
"lastStatus": "error",
"lastDurationMs": 115773,
"consecutiveErrors": 3,
"lastRunStatus": "error",
"nextRunAtMs": 1773140400000,
"lastRunAtMs": 1773054000006,
"lastStatus": "ok",
"lastDurationMs": 77600,
"consecutiveErrors": 0,
"lastRunStatus": "ok",
"lastDeliveryStatus": "not-delivered",
"lastDelivered": false,
"lastDeliveryError": "⚠️ ✉️ Message failed",
"runningAtMs": 1773054000004
"runningAtMs": 1773140400004
}
},
{
@@ -78,7 +77,7 @@
"name": "zq-knowledge-base-sync",
"enabled": true,
"createdAtMs": 1772551807455,
"updatedAtMs": 1772996418024,
"updatedAtMs": 1773082825570,
"schedule": {
"expr": "0 3 * * *",
"kind": "cron",
@@ -91,8 +90,8 @@
"text": "执行知识库同步:bash ~/.openclaw/cron/scripts/zq-sync.sh"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996418023,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082825569,
"lastStatus": "skipped",
"lastDurationMs": 1,
"consecutiveErrors": 0,
@@ -107,7 +106,7 @@
"name": "openclaw-backup",
"enabled": true,
"createdAtMs": 1772552362242,
"updatedAtMs": 1772996418024,
"updatedAtMs": 1773082825570,
"schedule": {
"expr": "0 3 * * *",
"kind": "cron",
@@ -120,8 +119,8 @@
"text": "执行 OpenClaw 备份:bash ~/.openclaw/cron/scripts/git-auto-sync.sh"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996418024,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082825570,
"lastStatus": "skipped",
"lastDurationMs": 0,
"consecutiveErrors": 0,
@@ -137,7 +136,7 @@
"description": "每天早上8点整理与各个 AI 代理的对话记录",
"enabled": true,
"createdAtMs": 1772776369645,
"updatedAtMs": 1773010817124,
"updatedAtMs": 1773100822304,
"schedule": {
"kind": "cron",
"expr": "0 8 * * *",
@@ -155,11 +154,11 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773097200000,
"lastRunAtMs": 1773010800003,
"nextRunAtMs": 1773187200000,
"lastRunAtMs": 1773100800004,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 17121,
"lastDurationMs": 22300,
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0
@@ -172,7 +171,7 @@
"description": "每天7点同步提醒到CalDAV日历",
"enabled": true,
"createdAtMs": 1772791528528,
"updatedAtMs": 1773010833994,
"updatedAtMs": 1773097253698,
"schedule": {
"kind": "cron",
"expr": "0 7 * * *",
@@ -190,11 +189,11 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773097200000,
"lastRunAtMs": 1773010817124,
"nextRunAtMs": 1773183600000,
"lastRunAtMs": 1773097230996,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 16870,
"lastDurationMs": 22702,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0,
"lastDelivered": true
@@ -207,7 +206,7 @@
"description": "每月10日执行北京房价监控,生成报告并推送",
"enabled": true,
"createdAtMs": 1772986312298,
"updatedAtMs": 1772986312298,
"updatedAtMs": 1773108253510,
"schedule": {
"kind": "cron",
"expr": "0 10 10 * *",
@@ -225,7 +224,15 @@
"to": "user:ou_9847ce84b960736c14554730b41e4957"
},
"state": {
"nextRunAtMs": 1773108000000
"nextRunAtMs": 1775786400000,
"lastRunAtMs": 1773108000005,
"lastRunStatus": "error",
"lastStatus": "error",
"lastDurationMs": 253505,
"lastError": "⚠️ ✉️ Message failed",
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 1
}
},
{
@@ -235,7 +242,7 @@
"description": "每天凌晨2:30整理昨天的已完成任务到每日回顾",
"enabled": true,
"createdAtMs": 1741484880000,
"updatedAtMs": 1741484880000,
"updatedAtMs": 1773081022764,
"schedule": {
"kind": "cron",
"expr": "30 2 * * *",
@@ -253,7 +260,14 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773081000000
"nextRunAtMs": 1773167400000,
"lastRunAtMs": 1773081000004,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 22760,
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0
}
}
]
+45 -32
View File
@@ -7,7 +7,7 @@
"name": "backup-openclaw-json",
"enabled": true,
"createdAtMs": 1772261581796,
"updatedAtMs": 1772996418023,
"updatedAtMs": 1773082825569,
"schedule": {
"kind": "cron",
"expr": "0 3 * * *",
@@ -23,10 +23,10 @@
"mode": "announce"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996400005,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082800006,
"lastStatus": "ok",
"lastDurationMs": 18018,
"lastDurationMs": 25563,
"consecutiveErrors": 0,
"lastRunStatus": "ok",
"lastDelivered": true,
@@ -39,7 +39,7 @@
"name": "capability-evolver-daily",
"enabled": true,
"createdAtMs": 1772550743528,
"updatedAtMs": 1772967715777,
"updatedAtMs": 1773054077606,
"schedule": {
"kind": "cron",
"expr": "0 19 * * *",
@@ -60,16 +60,14 @@
"to": "feishu-pm"
},
"state": {
"nextRunAtMs": 1773054000000,
"lastRunAtMs": 1772967600004,
"lastStatus": "error",
"lastDurationMs": 115773,
"consecutiveErrors": 3,
"lastRunStatus": "error",
"nextRunAtMs": 1773140400000,
"lastRunAtMs": 1773054000006,
"lastStatus": "ok",
"lastDurationMs": 77600,
"consecutiveErrors": 0,
"lastRunStatus": "ok",
"lastDeliveryStatus": "not-delivered",
"lastDelivered": false,
"lastDeliveryError": "⚠️ ✉️ Message failed",
"lastError": "⚠️ ✉️ Message failed"
"lastDelivered": false
}
},
{
@@ -78,7 +76,7 @@
"name": "zq-knowledge-base-sync",
"enabled": true,
"createdAtMs": 1772551807455,
"updatedAtMs": 1772996418024,
"updatedAtMs": 1773082825570,
"schedule": {
"expr": "0 3 * * *",
"kind": "cron",
@@ -91,8 +89,8 @@
"text": "执行知识库同步:bash ~/.openclaw/cron/scripts/zq-sync.sh"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996418023,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082825569,
"lastStatus": "skipped",
"lastDurationMs": 1,
"consecutiveErrors": 0,
@@ -107,7 +105,7 @@
"name": "openclaw-backup",
"enabled": true,
"createdAtMs": 1772552362242,
"updatedAtMs": 1772996418024,
"updatedAtMs": 1773082825570,
"schedule": {
"expr": "0 3 * * *",
"kind": "cron",
@@ -120,8 +118,8 @@
"text": "执行 OpenClaw 备份:bash ~/.openclaw/cron/scripts/git-auto-sync.sh"
},
"state": {
"nextRunAtMs": 1773082800000,
"lastRunAtMs": 1772996418024,
"nextRunAtMs": 1773169200000,
"lastRunAtMs": 1773082825570,
"lastStatus": "skipped",
"lastDurationMs": 0,
"consecutiveErrors": 0,
@@ -137,7 +135,7 @@
"description": "每天早上8点整理与各个 AI 代理的对话记录",
"enabled": true,
"createdAtMs": 1772776369645,
"updatedAtMs": 1773010817124,
"updatedAtMs": 1773100822304,
"schedule": {
"kind": "cron",
"expr": "0 8 * * *",
@@ -155,11 +153,11 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773097200000,
"lastRunAtMs": 1773010800003,
"nextRunAtMs": 1773187200000,
"lastRunAtMs": 1773100800004,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 17121,
"lastDurationMs": 22300,
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0
@@ -172,7 +170,7 @@
"description": "每天7点同步提醒到CalDAV日历",
"enabled": true,
"createdAtMs": 1772791528528,
"updatedAtMs": 1773010833994,
"updatedAtMs": 1773097253698,
"schedule": {
"kind": "cron",
"expr": "0 7 * * *",
@@ -190,11 +188,11 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773097200000,
"lastRunAtMs": 1773010817124,
"nextRunAtMs": 1773183600000,
"lastRunAtMs": 1773097230996,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 16870,
"lastDurationMs": 22702,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0,
"lastDelivered": true
@@ -207,7 +205,7 @@
"description": "每月10日执行北京房价监控,生成报告并推送",
"enabled": true,
"createdAtMs": 1772986312298,
"updatedAtMs": 1772986312298,
"updatedAtMs": 1773108253510,
"schedule": {
"kind": "cron",
"expr": "0 10 10 * *",
@@ -225,7 +223,15 @@
"to": "user:ou_9847ce84b960736c14554730b41e4957"
},
"state": {
"nextRunAtMs": 1773108000000
"nextRunAtMs": 1775786400000,
"lastRunAtMs": 1773108000005,
"lastRunStatus": "error",
"lastStatus": "error",
"lastDurationMs": 253505,
"lastError": "⚠️ ✉️ Message failed",
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 1
}
},
{
@@ -235,7 +241,7 @@
"description": "每天凌晨2:30整理昨天的已完成任务到每日回顾",
"enabled": true,
"createdAtMs": 1741484880000,
"updatedAtMs": 1741484880000,
"updatedAtMs": 1773081022764,
"schedule": {
"kind": "cron",
"expr": "30 2 * * *",
@@ -253,7 +259,14 @@
"channel": "last"
},
"state": {
"nextRunAtMs": 1773081000000
"nextRunAtMs": 1773167400000,
"lastRunAtMs": 1773081000004,
"lastRunStatus": "ok",
"lastStatus": "ok",
"lastDurationMs": 22760,
"lastDelivered": true,
"lastDeliveryStatus": "delivered",
"consecutiveErrors": 0
}
}
]
+5 -2
View File
@@ -8,8 +8,11 @@ OUTPUT_BASE="$HOME/work/zq/30.资源/AI会话历史"
ZQ_DIR="$HOME/work/zq"
OPENCLAW_DIR="$HOME/.openclaw"
LOG_FILE="$HOME/work/backup/ai-conversation-logger.log"
YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)
CURRENT_MONTH=$(date -d "yesterday" +%Y-%m)
export YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)
export CURRENT_MONTH=$(date -d "yesterday" +%Y-%m)
# 确保日志目录存在
mkdir -p "$(dirname "$LOG_FILE")"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
+27 -3
View File
@@ -7,20 +7,34 @@ set -e
WORK_DIR="/home/starmen1265/work/zq"
TODO_FILE="$WORK_DIR/01.待办/TODO.md"
REVIEW_DIR="$WORK_DIR/40.归档/每日回顾"
LOG_FILE="$HOME/work/backup/daily-review.log"
# 获取昨天的日期(格式:YYYY-MM-DD)
YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)
REVIEW_FILE="$REVIEW_DIR/$YESTERDAY.md"
# 确保日志目录存在
mkdir -p "$(dirname "$LOG_FILE")"
mkdir -p "$REVIEW_DIR"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
}
log "=== 每日回顾整理开始 ==="
log "处理日期: $YESTERDAY"
# 切换到工作目录
cd "$WORK_DIR"
# 如果没有已完成的任务,直接退出
if ! grep -q "\[x\]" "$TODO_FILE"; then
echo "No completed tasks found. Exiting."
log "没有已完成的任务,跳过"
exit 0
fi
log "发现已完成的任务"
# 提取已完成的任务(保留标题结构)
# 读取TODO.md,提取所有包含[x]的行及其所属标题
COMPLETED_TASKS=$(awk '
@@ -37,10 +51,12 @@ COMPLETED_TASKS=$(awk '
# 如果每日回顾文件不存在,创建它
if [ ! -f "$REVIEW_FILE" ]; then
touch "$REVIEW_FILE"
log "创建每日回顾文件: $REVIEW_FILE"
fi
# 将完成的任务追加到每日回顾文件(去掉✅及后面的日期)
echo "$COMPLETED_TASKS" | sed 's/ ✅ [0-9-]*$//' >> "$REVIEW_FILE"
log "已添加任务到每日回顾"
# 从TODO.md中删除已完成的任务行
sed -i '/\[x\]/d' "$TODO_FILE"
@@ -68,7 +84,15 @@ awk '
' "$TODO_FILE" > "$TODO_FILE.tmp" && mv "$TODO_FILE.tmp" "$TODO_FILE"
# 提交git变更
git add "$TODO_FILE" "$REVIEW_DIR/$YESTERDAY.md"
git commit -m "每日回顾整理:$YESTERDAY" || echo "No changes to commit"
git add "$TODO_FILE" "$REVIEW_FILE"
git commit -m "每日回顾整理:$YESTERDAY" >> "$LOG_FILE" 2>&1 || log "Git提交无变更"
# 同步到 NAS
log "推送到 NAS..."
rclone copy "$REVIEW_FILE" "nas-webdav:/home/Drive/工作区/张青/工作区/40.归档/每日回顾/" \
--log-level INFO >> "$LOG_FILE" 2>&1 || log "警告:rclone 推送失败"
rclone copy "$TODO_FILE" "nas-webdav:/home/Drive/工作区/张青/工作区/01.待办/" \
--log-level INFO >> "$LOG_FILE" 2>&1 || log "警告:rclone 推送失败"
log "=== 每日回顾整理完成 ==="
echo "Daily review completed for $YESTERDAY"