auto backup 2026-04-06 08:18:35
This commit is contained in:
parent
77096a6bda
commit
7c0ad5fa1c
@ -25,3 +25,4 @@ remote: Processed 1 references in total
|
||||
To https://git.valavala.com/ai_member_only/ai_member_xiaobian.git
|
||||
1ea0346..09615da master -> master
|
||||
✅ 备份完成:Sun Apr 5 08:10:02 AM CST 2026
|
||||
{"code":9499,"msg":"Bad Request","error":{"log_id":"20260406080007E051951EAC2C5CF4D23F","troubleshooter":"排查建议查看(Troubleshooting suggestions): https://open.feishu.cn/search?from=openapi&log_id=20260406080007E051951EAC2C5CF4D23F&code=9499&method_id=6936075528891154460"}}
|
||||
@ -15,19 +15,15 @@ git commit -m "auto backup $(date +'%Y-%m-%d %H:%M:%S')" || true
|
||||
git push origin master || true
|
||||
|
||||
# 备份成功后发送通知给李若松
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
if [ $? -eq 0 ] || [ $? -eq 1 ]; then
|
||||
# 获取飞书token
|
||||
APP_ID=$(jq -r '.apps[0].appId' /root/.openclaw/credentials/xiaobian/config.json)
|
||||
APP_SECRET=$(jq -r '.apps[0].appSecret' /root/.openclaw/credentials/xiaobian/config.json)
|
||||
FEISHU_TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" | jq -r '.tenant_access_token')
|
||||
|
||||
# 发送消息
|
||||
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=user_id" \
|
||||
-H "Authorization: Bearer $FEISHU_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"receive_id": "4aagb443", "msg_type": "text", "content": "{\"text\":\"✅ 小编Workspace自动备份成功,备份时间:'$(date +'%Y-%m-%d %H:%M:%S')'\"}"}' >> "$WORKSPACE_DIR/logs/backup.log" 2>&1
|
||||
# 使用openclaw message工具发送通知,自动使用xiaobian账号
|
||||
/root/.nvm/versions/node/v24.14.0/bin/node /root/.nvm/versions/node/v24.14.0/bin/openclaw message send \
|
||||
--channel feishu \
|
||||
--target user:4aagb443 \
|
||||
--message "✅ 小编Workspace每日自动备份完成($(date +'%Y-%m-%d %H:%M'))
|
||||
提交哈希:$COMMIT_HASH
|
||||
所有Workspace变更已同步到远程Git仓库" >> "$WORKSPACE_DIR/logs/backup.log" 2>&1
|
||||
fi
|
||||
|
||||
echo "✅ 备份完成:$(date)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user