Hi,
I am trying to use a generic script called ftp_master.ksh and use it in my script to FTP multiple files and log them. But I am unable to do so. I am not sure where I am going wrong...
My script:
SERVER=$1
REMOTE_FILE_PATH=$2
file_count=`expr $# - 3`
echo "Total files to be ftped : ${file_count} "
LOCAL_FILE_PATH=/apps/inbound
LOG_FILE=$LOG_DIR/ftpPullFiles_log.${RUNTIME}
cd ${LOCAL_FILE_PATH}
#------------------------------------------------------
# File 1
#------------------------------------------------------
REMOTE_FILE_NAME=$3
$SCRIPTS/ftp_master.ksh -g -s ${REMOTE_FILE_PATH}/${REMOTE_FILE_NAME} -d ${LOCAL_FILE_PATH}/${REMOTE_FILE_NAME} -v {SERVER} >
$LOG_FILE
files_trnsf=`grep -c ^"226 " ${LOG_FILE}`
if [ "$files_trnsf" -eq 1 ]
then
echo "File ${REMOTE_FILE_NAME} FTPed Successfully from ${SERVER}"
#rm ${LOG_FILE}
else
echo "ERROR occured while FTPing file ${REMOTE_FILE_NAME} from ${SERVER}."
echo "See log ${LOG_FILE} for details"
exit 1
fi
if [ "$file_count" -eq 1 ]
then
exit 0
fi
ftp_master has parameters like -g (get), -s (source filename), -d (destination filename) and -v (server)....
I think the log file generated doesn't have the code 226 or something....
I would appreciate your help...