FTP files are not moving/copying

Hi

I want to FTP some file from one server to another server, those file should copy from one server to another and then move the same files to another folder in the same server. I have written the code but the text files are moving and coping but the remaing file are not moving or coping to another server or different folder. Would you please help on this

EX: Server1 and server2

Server1 is having folder abc/bcd/cde and having file .txt,.xls,.eof, etc..
i want to copy into Sever2 as abc/bcd/cde of all above said files
and also move to abc/bcd/cde/back in to sever1

Code:

#!/bin/sh

cd /abc/bcd/cde

FTP_SRVR=<host name>
FTP_USR=xxxxxx
FTP_PWD=zzzzzzzz

TODAYS_FILE=&DAY.&HR.&MIN.&SEC

ftp -vn <<EOF

open $FTP_SRVR
user $FTP_USR $FTP_PWD
cd /abc/bcd/cde

binary

mput $TODAYS_FILE

bye

EOF
mv /abc/bcd/cde/$TODAYS_FILE /abc/bcd/cde/back

Regards,
Sridhar

What error do you get?

This looks strange to wrong:

This will not be substituted to any usable by the ksh or bash. Maybe you use the date command like:

TODAYS_FILE=`date +%d.%H.%M.%S`

Hi

I .txt files are copying from sev1 to sev2 but the remaing files are not copying/mvoing to another file
and getting error like "mv: cannot rename /sap/DB1/hulftuser1/temp/ to /sap/DB1/hulftuser1/temp/back/tem
p/: Invalid argument"

could you please help

does the /sap/DB1/hulftuser1/temp/back directory exist?

hi

Yes it exists..