#!/bin/bash
# Tier 1 Sweep — background runner with safe defaults
# Usage: bash bot_tier1_sweep.sh [max_rows]

cd /var/www/html/crpytotradingbot

MAX_ROWS="${1:-2000000}"
LOG_FILE="results/tier1_sweep.log"

mkdir -p results

echo "Starting Tier 1 sweep (max_rows=$MAX_ROWS)..."
echo "Log: $LOG_FILE"

nohup python3 run_tier1_sweep.py --max-rows=$MAX_ROWS > "$LOG_FILE" 2>&1 &
PID=$!
echo "PID: $PID"
echo "Monitor: bash bot_check.sh  OR  tail -f $LOG_FILE"
