#!/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"
