Files
exchange-monitor-go/morning_report.sh
T
jackyu66git 5f6578c179 feat: add 17 new cross-exchange pairs (BG↔HL)
Added: ALGO, PYTH, SAND, ADA, HBAR, IOTA, MINA, FET, WLD,
       SUI, APT, NEAR, FIL, DYDX, JUP, TIA, MOVE

Removed: pixel and VET (fake 195% spreads on testnet)

Also updated GetHLSize() to handle szDecimals for all new coins.
2026-05-04 18:05:53 +08:00

36 lines
912 B
Bash

#!/bin/bash
# Morning summary script — triggered by cron at 8 AM
PROJECT_DIR="/home/jack/Project/exchange-monitor-go"
STATS_FILE="$PROJECT_DIR/trade_stats.txt"
LOG_FILE="$PROJECT_DIR/morning_summary.txt"
# Find the PID of the exchange-monitor process
PID=$(pgrep -f "exchange-monitor" | head -1)
if [ -n "$PID" ]; then
# Send SIGUSR1 to dump stats
kill -USR1 "$PID" 2>/dev/null
sleep 2
# Read stats
if [ -f "$STATS_FILE" ]; then
cat "$STATS_FILE"
echo ""
echo "=== 程序状态 ==="
ps -p "$PID" -o pid,etime,cmd --no-headers 2>/dev/null || echo "进程已结束"
fi
# Kill the process
kill "$PID" 2>/dev/null
sleep 1
kill -0 "$PID" 2>/dev/null && kill -9 "$PID" 2>/dev/null
echo ""
echo "程序已停止 (PID: $PID)"
else
echo "未找到运行中的 exchange-monitor 进程"
fi
echo "=== 报告完成 ==="