From 37bfbad921e5024efd6fdd394726d39aec7ee102 Mon Sep 17 00:00:00 2001 From: hmo Date: Tue, 21 Jul 2026 01:00:58 +0800 Subject: [PATCH] feat: add cron wrapper scripts for OCG and Kimi local collectors - ocg_collect.sh: local OCG collection via HTTP+cookies - kimi_collect_local.sh: local Kimi collection via Playwright CDP - Replaces kimi_collect.sh (SSH-to-Windows approach) --- gateway/scripts/kimi_collect_local.sh | 12 ++++++++++++ gateway/scripts/ocg_collect.sh | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gateway/scripts/kimi_collect_local.sh create mode 100644 gateway/scripts/ocg_collect.sh diff --git a/gateway/scripts/kimi_collect_local.sh b/gateway/scripts/kimi_collect_local.sh new file mode 100644 index 0000000..e6ed756 --- /dev/null +++ b/gateway/scripts/kimi_collect_local.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Kimi usage collector (local Playwright, no SSH needed) +# Called from crontab (every 10 min) +set -euo pipefail + +LOG="/home/hmo/AgentsMeeting/gateway/logs/kimi_collect.log" +SCRIPT="/home/hmo/AgentsMeeting/gateway/scripts/usage_collector_kimi_local.py" +PY="/home/hmo/agentsmeeting-venv/bin/python3" + +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting local Kimi collection..." >> "$LOG" +"$PY" "$SCRIPT" >> "$LOG" 2>&1 +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Done (rc=$?)" >> "$LOG" diff --git a/gateway/scripts/ocg_collect.sh b/gateway/scripts/ocg_collect.sh new file mode 100644 index 0000000..b6081ff --- /dev/null +++ b/gateway/scripts/ocg_collect.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# OCG usage collector (local, no SSH needed) +# Called from crontab +set -euo pipefail + +LOG="/home/hmo/AgentsMeeting/gateway/logs/ocg_collect.log" +SCRIPT="/home/hmo/AgentsMeeting/gateway/scripts/usage_collector.py" +PY="/home/hmo/agentsmeeting-venv/bin/python3" + +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting OCG collection..." >> "$LOG" +"$PY" "$SCRIPT" >> "$LOG" 2>&1 +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Done (rc=$?)" >> "$LOG"