#!/bin/sh
# rc_run_0017.sh - 대사 실행 러너 (hard)
# 사용법: rc_run_0017.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_0017_${BIZDATE}.log"

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