how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt
i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this?

thanks in advance! Im a newbie to this...

Did you have a look at the forums' FAQ ?

Here is a link - Automate FTP / Scripting FTP Transfers

ok thanks! however, now i need to put all the text files in a directory over to the other server. The directories contains other files beside text files. i only need to put text files. I now only manage to put a single text file to the other server. I also have error in my coding.....

Heres my coding:
set FILENAME = /local/filename.log

ftp -v -n "myipadd" << cmd
user "user" "passwd"
cd /remote/FTP
lcd /local/ ssh_install

ls -1 *.txt $local_path > $FILENAME

put $FILENAME
quit
cmd

You can use mput *.txt

Before doing that, you need to turn off the interactive mode of FTP. Just use prompt before doing the mput.

Thanks vino! the script is working fine now :stuck_out_tongue: