FTP script not working

hi

I have made d below ftp script but the last part of script ie. moving the files after transfer (to a location in the source server only) is not working for me.

Can anybody pls..help.in same..!!!

#######################################################
#!/bin/sh
ftp -n 10.209.13.11 <<END_SCRIPT
quote USER xyz
quote PASS xyz
bin
prompt
cd /test
put reports.zip reports.tmp
rename reports.tmp reports.zip
#quit
bye
#END_SCRIPT
#exit 0
echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/

exit 0
END_SCRIPT
#############################################################

Please use the Search function of the forum, there are more than 10 variations of such script.

echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/
exit0

this part should be placed after the "END_SCRIPT" since you already exited from the ftp prompt.

it should be:

#######################################################
#!/bin/sh
ftp -n 10.209.13.11 <<END_SCRIPT 
quote USER xyz
quote PASS xyz
bin
prompt
cd /test
put reports.zip reports.tmp
rename reports.tmp reports.zip
bye
END_SCRIPT

echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/
exit 0

#############################################################

hope this helps :smiley:

many thanks