COTexplorer/scripts/cron_entrypoint.sh
Greg 37f8eac932 Initial commit: CFTC COT Explorer
FastAPI application that ingests CFTC Commitments of Traders data into SQLite
and exposes it via a REST API with analytics endpoints (screener, percentile rank,
concentration). Includes CLI for historical and weekly data ingestion, Docker setup,
and a frontend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 11:23:00 +01:00

23 lines
601 B
Bash
Executable File

#!/bin/sh
set -e
echo "[cron] Initializing database..."
python3 -m app.ingestion.cli init-db
echo "[cron] Importing local HTML files from /app/data ..."
python3 -m app.ingestion.cli import-local-html --data-dir /app/data
echo "[cron] Running historical import (skips already-imported sources)..."
python3 -m app.ingestion.cli import-history
echo "[cron] Database status:"
python3 -m app.ingestion.cli status
echo "[cron] Installing crontab..."
cp /app/scripts/crontab /etc/cron.d/cot-cron
chmod 0644 /etc/cron.d/cot-cron
crontab /etc/cron.d/cot-cron
echo "[cron] Starting crond..."
exec cron -f