Hi Guys,
Can someone help me on ftping files via shell script please ?
i have created a script but its getting st-rucked after connecting to
the ftp location (i can see that logs).
Please see below i have pasted script and log.
#SCRIPT#
.env
set -a
##################
#Local Variables
##################
LOGDIR=/logs
LOGFILE=ftp.log
PICKUPDIR=/alpha/beta/
DROPDIR=/home/shiva/
DATE=`date +%Y-%m-%d`
GATEWAY=12.25.30.25
USERID=shivaprasath
PASSWD=cmm1234
###########
#FUNCTIONS#
###########
#function to pull Files
ftp_copy ()
{
ftp -in $GATEWAY
user ${USERID} ${PASSWD}
cd ${PICKUPDIR}
lcd ${DROPDIR}
mget MP3_${DATE}*
bye
!
} >> $LOGDIR/$LOGFILE
#############
#Main Script#
#############
echo "Starting Files ftp: \c" >> $LOGDIR/$LOGFILE
date >> $LOGDIR/$LOGFILE
ftp_copy
echo "Ending Files ftp: \c" >> $LOGDIR/$LOGFILE
wait
date >> $LOGDIR/$LOGFILE
exit 0
#End of Script#
# ftp.log#
Starting Files ftp: Wednesday, 4 April 2012 16:21:43 BST
Connected to 12.25.30.25.
Welcome to the FTP Site
Remote system type is Windows_NT.
ftp>
ftp>
Regards,
Shiva