#!/bin/sh
# cl_run_0013.sh - 마감 실행 러너 (easy)
# 사용법: cl_run_0013.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/cl_run_0013_${BIZDATE}.log"

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