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