AIX FTP question.

From: Suhas (sgtembe_at_hotmail.com)
Date: 05/12/04


Date: 12 May 2004 10:52:48 -0700

Hello Everyone,

We have AIX 5.2 & I am trying to get a file from a server using ftp.
This is how my script

looks:

(
  echo user $USERID $PASSWORD
  echo ls
  echo binary
  echo passive
  echo mget *
  echo quit
) | ftp -v -n -i dname.com 21

I know that there is one file out on the server that I can download.
However, when I execute

my script, it does not do anything. Here is the output log file:

Connected to dname.com.
220 txdmz09 FTP proxy (Version V2.1) ready.
331-(----GATEWAY CONNECTED TO xxx.xxx.xxx.xx----)
331-(220 <<<CONNECT:Enterprise for UNIX 1.3.01 Secure FTP>>> at
txdmz62 FTP serv
er ready. Time = 12:17:26)
331 Password required for USERNAME.
230 CONNECT:Enterprise for UNIX login ok, access restrictions apply.
200 PORT command successful.
150 Opening ASCII mode data connection for .
-AR-------TCP B ceunix 15130 1463 May 12 09:43 FILENAME
Total number of batches listed: 1
226 Transfer complete.
200 Type set to I.
Passive mode on.
221 Goodbye.

But, when I execute the same set of ftp commands from the command
line, it works! Here is

the output log:

$ftp -v -n -i dname.com 21
Connected to dname.com.
220 txdmz09 FTP proxy (Version V2.1) ready.
501 Cannot connect to authentication server
Name (dname.com:stembe): USERNAME
331-(----GATEWAY CONNECTED TO xxx.xxx.xxx.xx----)
331-(220 <<<CONNECT:Enterprise for UNIX 1.3.01 Secure FTP>>> at
txdmz62 FTP serv
er ready. Time = 11:30:50)
331 Password required for USERNAME.
Password:
230 CONNECT:Enterprise for UNIX login ok, access restrictions apply.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for .
-AR-------TCP B ceunix 15130 1463 May 12 09:43 FILENAME
Total number of batches listed: 1
226 Transfer complete.
ftp> binary
200 Type set to I.
ftp> passive
Passive mode on.
ftp> mget *
mget FILENAME? y
227 Entering Passive Mode (171,161,160,119,226,30)
150 Opening BINARY mode data connection for FILENAME.
226 Transfer complete.
1918 bytes received in 1.972 seconds (0.9499 Kbytes/s)
local: FILENAME remote: FILENAME
ftp> quit
221 Goodbye.

Any ideas as to why it would not work thru the script?

Thanks for the help.
Suhas



Relevant Pages

  • FTP question
    ... enter "ftp ftp.blahblahblah.com". ... abc (I have entered the User ID "abc". ... echo off ... wait for the prompt ...
    (microsoft.public.windows.vista.general)
  • AIX FTP question
    ... We have AIX 5.2 & I am trying to get a file from a server using ftp. ... echo user $USERID $PASSWORD ... 150 Opening ASCII mode data connection for. ... Passive mode on. ...
    (comp.unix.shell)
  • FTP question...
    ... enter "ftp ftp.blahblahblah.com". ... abc (I have entered the User ID "abc". ... echo off ... wait for the prompt ...
    (microsoft.public.windowsxp.general)
  • Re: FTP question
    ... enter "ftp ftp.blahblahblah.com". ... abc (I have entered the User ID "abc". ... echo off ... wait for the prompt ...
    (microsoft.public.windows.vista.general)
  • Interactive Login Works, Script Login Fails
    ... i am writing a script for a client, ... download all files from an ftp site, which they can set up in task scheduler ... > ftp.scr ECHO OPEN ftp.server.com ... with error "530 User myuser cannot log in." ...
    (microsoft.public.inetserver.iis.ftp)