Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp from windows to unix

Status
Not open for further replies.

ssaachi

Technical User
Sep 24, 2001
42
US
I need a script in windows that I can run to ftp files from my desktop to many of my unix servers.
I created a bat file ( this is a script that we use in unix to ftp files ) with the following info but it does not work.
Please help
ftp -v -n -i 111.19.13.126 <<EOF
user uid pwd
bin
put test.tar
bye
EOF
I have been using ssh secure file transfer to transfer files to all my servers but that is slow. I need to have a script where I can ftp to al lthe servers I need.
thanks


 
@echo off
echo open remotehosts > script.dat
echo USER username>> script.dat
echo password>> script.dat
echo cd directory>> script.dat
echo put filename>> script.dat
echo bye>> script.dat
FTP -n -s:script.dat
del script.dat

HTH
-bp
 
blainepruitt :
i do not know 'dos' and 'window',your exemple is ok but you are opening and closing 6 time the same filedescriptor. this is not wrong, in unix i write, my be it also works on your system:

(
echo open remotehosts
echo USER username
echo password
echo cd directory
echo put filename
do-somethings-else #output goes also to script.dat
echo ....
echo ....
echo bye
)> script.dat

# is the 'rem' char in unix-shell.
------------ jamisar
Einfachheit ist das Resultat der Reife. (Friedrich Schiller)
Simplicity is the fruit of maturity.
 
Jamisar,

Unfortunately Windows and Unix do not work alike. True, in Unix you can write an FTP script without the help of a second file, but windows requires a script to be read, while unix is smart enough to read straight code.
 
blainepruitt:
i don't understand you, did you undestand me ?? ------------ jamisar
Einfachheit ist das Resultat der Reife. (Friedrich Schiller)
Simplicity is the fruit of maturity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top