#!/bin/bash
##
## run_eod.sh - cm 일마감 배치 일괄 실행
## 운영 스크립트: Enduro/X + ECPG/XA 런타임 환경을 설정하고 배치/서비스를 실행.
##   Usage: run_eod.sh [BIZDATE]
##
set -e
. /app/conf/setapp.sh

BIZDATE="${1:-2026-07-19}"

echo "[run_eod.sh] BIZDATE=$BIZDATE"
for b in cm_logcnt_batch cm_logroll_batch cm_svcacc_batch cm_fxsum_batch cm_fxspread_batch \
         cm_errbps_batch cm_levelstat_batch cm_marker_batch cm_archive_batch cm_purge_batch; do
    echo "--- $b $BIZDATE ---"; "/app/bin/$b" "$BIZDATE" || exit 1
done
