Automate FTP

Hi all,

I got this piece of code in this forum and I can't seem to get it work. The thread already closed so I just post a new thread.

#!/usr/bin/ksh
ftp -v -n "YOUR.IP.ADD.RESS" << cmd
user "user" "passwd"
cd /distant/directory
lcd /local/directoryget ssh_install
get ( or put) your files
quit
cmd

Do I run this script from the Unix side, or the command line (c-prompt) in window side?
cd /distant/directory is the directory on the unix server where i want the file ftp to?
lcd /local/directoryget ssh_install is the directory on my window pc where i want to get the file from?

Thanks

CT

This code is intended to be run on a unix computer that needs to connect to an ftp server. I don't believe that we have any code intended to run on a windows computer that need to to connect to an ftp server.

you have to run it on unix, but i think you have to write the quit sequence like:
#!/usr/bin/ksh
command << cmd
......
....
...
..
!cmd

gP

Definitely this is the UNIX side. You can use the Windows ftp to copy files in batch by using the -s argument as follows:

ftp -s:ftpscriptfilename

scriptfilename contains all of the commands that you want to send to the ftp server on UNIX.

Thomas

It does connect to the server and everything, but it can't find the file from my share drive to put on the UNIX server. I was just wondering, if you have it automate to run at certain time. How does it know what "lcd" directory of the local machine to find the file from?

CT