1836768 Members
2251 Online
110109 Solutions
New Discussion

FTP script quit working

 
SOLVED
Go to solution
Ed Hon
Regular Advisor

FTP script quit working

I have an ftp script on HP-UX 11.0 that has suddenly stopped working:

cd /home/xfer
echo "
open dxs.us.abb.com
user
type ascii
cd fromdir
append filename
close
" | ftp -i -n

It now generates errors:

421 Service not available, remote server has closed connection
Not connected.
Not connected.
Not connected.
Not connected.

Now, here's the kicker. If I open an ftp session from a command line, type "open dxs.us.abb.com" at the ftp prompt, then reply to Name" with and to Password with , it works everytime! Why won't the script work?? (If it make any difference, the FTP server is Microsoft FTP Service (Version 5.0)) Thanks.
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: FTP script quit working

Hi,

Try with '-v' in the ftp line and see what additional errors you see.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Geoff Wild
Honored Contributor
Solution

Re: FTP script quit working

Instead of piping, try this:

ftp -nv dxs.us.abb.com << EOF > /tmp/ftp.log
user ${USERNAME} ${PASSWORD}
type ascii
cd fromdir
append filename
quit
EOF

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: FTP script quit working

I think the change in post 2 will do the trick.

Microsoft's ftp server does not apply to standards and could be a contributing factor.

Another question to ask if the script worked and stopped, is what changed?

Was there a change or patch on the Microsoft ftp server?

SEO
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ed Hon
Regular Advisor

Re: FTP script quit working

I don't know if there were any patches applied to Microsoft FTP Server. The site is not in our company, so it would take some time to find out. Taking out the piping seems to have worked. Thanks to all.