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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated FTP fetch to UNIX host from Windows Client 1

Status
Not open for further replies.

Zugdud

IS-IT--Management
Feb 26, 2003
158
US
Howdy folks, Im just trying to come up with a batch file that will download a tarball off of my ftp account but i keep getting stuck at the login. I've tried both, with and without the -n option

ftp -n salt.dreamhost.com
user
username
password
binary
get test.txt
quit

Any thoughts? Thanks!
 
faq80-965
faq80-772

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks, those scripts make sense but both of them are for uploading a file. I tried:

ftp -n salt.dreamhost.com
user username password
bin
get test.txt
quit

But I still seem to not be logging in right, when i run the script i get an ftp prompt but it just says 530 PLEASE LOGIN WITH USER AND PASS
 
ftp -n salt.dreamhost.com <<EOF
user username password
bin
get test.txt
quit
EOF

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You title says you a "fetch to Unis host" from "windows client".
This implies that you have a FTP SERVER on your Windows Client. Do you?

Also can you please post the full output of the ftp command, as there may be another error that may help solve the problem.




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Well I still seem to be getting stuck, tried a few things like << EOF , <<EOF, <<! after the first line. Yes, the username and password I am using are correct =)

Any ideas? I tried contacting my host but he said, they don't offer assistance on scripting. Fair policy I guess...

Anyway I appricate all the help this far. Ive tried a few varients of the batch file but still no luck, i even tried <<EOF, << EOF , <<! after the first line of the batch file but that seemed to prevent it from running correctly.

//====================================
// Batch File 1 Start
//====================================

ftp -n salt.dreamhost.com
user username password
dir
EOF

//====================================
// Batch File 1 End
//====================================

//====================================
// Output 1 Start
//====================================
C:\>testftp.bat

C:\>ftp -n salt.dreamhost.com
Connected to salt.dreamhost.com.
220 ProFTPD 1.2.5rc1 Server (DreamHost FTP) [salt.dreamhost.com]
ftp>

//====================================
// Output 2 End
//====================================

Now after about 30 seconds I type a command, like dir to see whats going on and this is the output i get.

ftp> dir
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp>

If I remove the -n argument this is what I get for

//====================================
// Batch File 2 Start
//====================================

ftp salt.dreamhost.com
user username password
dir
EOF

//====================================
// Batch File 2 end
//====================================

//====================================
// Output 2 Start
//====================================


C:\>testftp.bat

C:\>ftp salt.dreamhost.com
Connected to salt.dreamhost.com.
220 ProFTPD 1.2.5rc1 Server (DreamHost FTP) [salt.dreamhost.com]
User (salt.dreamhost.com:(none)):

//====================================
// Output 2 End
//====================================

If I hit enter I get a 500 'USER': command requires a parameter.


 
Oh sorry, yes I am running this batch file on a windows XP workstation and attempting to connect to a UNIX Host. Sorry if the title misled anyone
 
Have a file, say ftp.cmd:[tt]
user username password
bin
get test.txt
quit[/tt]
Then your batch file, testftp.bat[tt]
ftp -n -s:ftp.cmd salt.dreamhost.com[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Wow that was it, thanks!!! Works like a charm now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top