#/!bin/sh
export WORK_DATE=`date +"%Y%m%d"`
#export WORK_DATE=20180101
echo $WORK_DATE
SRC_PATH=/app_data/tcs/FILE/SEND/WORK
DESC_PATH=/files/app_data/tcs/FILE/SEND/WORK
# 남산1호터널(구) ID/PASSWD
NSIP=192.168.201.120
NSUSER=tcs
NSPASS=tcs
NSPORT=22

#RFID_CARS_INFO 정보를 CSV로 생성
cd /app/tcs/GREEN_LANE/jar/z
sqlplus NAMSAN/namsan@150.50.46.11:1521/ora91 < rfid_cen.sql
 sed '/SQL>/d' RFID_CARS_INFO_CEN.CSV > RFID_CARS_INFO_CEN_.CSV
iconv -f EUC-KR -t UTF-8 RFID_CARS_INFO_CEN_.CSV -o RFID_CARS_INFO_CEN_8.CSV
cp RFID_CARS_INFO_CEN_8.CSV $SRC_PATH/RFID_CARS_INFO_$WORK_DATE.CSV

#생성된 CSV 파일을 수집서버로 송신
#/app/tcs/GREEN_LANE/bin/mput.sh $NSIP $NSUSER $NSPASS $DESC_PATH $SRC_PATH RFID_CARS_INFO_$WORK_DATE.CSV $NSPORT

#수집서버로 ssh접속하여 shell 실행
#sshpass ssh -o StrictHostKeyChecking=no $NSUSER@$NSIP /home/tcs/GREEN_LANE/bin/putWebSever.sh RFID RFID_CARS_INFO_$WORK_DATE.CSV
