Discussion Locked

FTP

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can anyone send me a sample ftp script for copying files from one server to another based on ip address.

An ftp home directory has already been created on the destination server

5 replies

by gesquiere.k

I'm not quite sure what you're looking for when you're talking about ip addresses, but this is a script that creates a command file which you can then execute with ftp on NT. This copies all files in directory files to the FTP directory (/homdir) ofserver 194.xxx.xxx.xxx. But because file-exist errors are fatal I also deleted the files on the FTP first.

echo user username password > goftp.txt
echo cd /homdir >> goftp.txt
for %%i in (files\*.*) do @echo del %%i >> goftp.txt
for %%i in (files\*.*) do @echo put %%i >> goftp.txt
echo bye >> goftp.txt
type goftp.txt | ftp -n 194.xxx.xxx.xxx

Hope this will help,
Kurt.

by james_randy

The first answer looks good to me. If that doesn't work, try something else. Hope this helps.

This discussion is closed to new replies.