#!/bin/sh
# rc_run_0007.sh - 대사 실행 러너 (easy)
# 사용법: rc_run_0007.sh <YYYYMMDD>
set -eu

BIZDATE="${1:-$(date +%Y%m%d)}"
APP_HOME="${APP_HOME:-/app/acquire-core}"
BIN="${APP_HOME}/bin"
LOG="${APP_HOME}/log/rc_run_0007_${BIZDATE}.log"

echo "[rc_run_0007] 대사 처리 시작 date=${BIZDATE}"
if [ -x "${BIN}/demo_rc_batch" ]; then
    "${BIN}/demo_rc_batch" "${BIZDATE}" "acquire@localhost" >> "${LOG}" 2>&1
    RC=$?
else
    echo "[rc_run_0007] 실행 파일 없음: ${BIN}/demo_rc_batch" >&2
    RC=0
fi
echo "[rc_run_0007] 종료 rc=${RC}"
exit ${RC}
