1751794 Members
5015 Online
108781 Solutions
New Discussion юеВ

Re: FTP Program advice

 
djoshi
Frequent Advisor

FTP Program advice

Hello all,

I want any FTP program to transfer files between two HP-UNIX 10.02 machine and which tells us the reason if the FTP fails?

Can any one advice me on this.
11 REPLIES 11
James R. Ferguson
Acclaimed Contributor

Re: FTP Program advice

Hi:

> I want any FTP program...

What does that mean, a script to leverage FTP?

In a shell, you might capture an FTP session's information with verbose logging:

# ftp -in -v >> /var/tmp/ftplog.$$ 2>&1

You could then parse the log looking for specific strings of text and/or the specific replies made by the FTP daemon. Each reply begins with a three-digit value. Look at the manpages for 'ftpd(1M)' for how to interpret these and/or their textual description. Be advised that the actual text may vary among different server implementations.

In Perl, you could use the 'Net::FTP' module. This allows straightforward logic, like:

$ftp->login() or die "..."

...and:

$ftp->put($localf, $remotef) or die "..."

...which gives you the ability to report whatever and however you like.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: FTP Program advice

Shalom,

You may wish to try snarf.
http://hpux.cs.utah.edu/hppd/hpux/Networking/FTP/snarf-7.0/

It may be a new version, if so search the parent site for snarf

Or a script.

ftp -i -n -v <<-ftpend


open maquina_remota


user Nome_do_Usuario password


binary


cd /diretorio_remoto


lcd /diretorio_local


get arquivo_remoto


put arquivo_local


quit


ftpend

You will get diagnostics. No promise that it will be actually useful information. It is after all Unix. Beats a crashing windows gui.

SEP
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
Steven Schweda
Honored Contributor

Re: FTP Program advice

> [...] HP-UNIX 10.02 [...]

HP-UX 10.20?

uname -a

Where did you find an FTP program which does
_not_ tell you the reason if the FTP fails?
What, exactly are you trying to do?
djoshi
Frequent Advisor

Re: FTP Program advice

Thx for suggestion.

can you please advise me how about ncftpput? Is anybody use this ftp program? if yes, Please advise me for HP-UNIX?

http://www.ncftp.com/

Thx,
Steven E. Protter
Exalted Contributor

Re: FTP Program advice

Shalom,

I've used the client, a few years ago.

I did not find it very inspiring.

If you are looking for a client, see snarf or if filezilla can be compiled on your Unix box.

As far as ftp server goes, whenever possible I shut it down and don't use it all all. Clear text authentication scares me.

SEP
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
Steven Schweda
Honored Contributor

Re: FTP Program advice

> [...] can you please advise me [...]

You might get better advice if you explained
exactly what you wish to do.

And before asking here about some third-party
product, you might try to explain why the
built-in software is not good enough.
djoshi
Frequent Advisor

Re: FTP Program advice

Below is what I am trying to do.

We already have ftp program to transfer files and we are using default ftp for this.

Sometimes the ftp program is failing and we don't know the reason of fail. That's why we need a program which tells us the reason why the ftp is failing. Is ftp return any exit codes of fail?

Please advice me how to accomplish my requiremet.

Thx,


Tingli
Esteemed Contributor

Re: FTP Program advice

You can use:

ftp -inv -T 12 $REMOTESITE < ftp_info | grep 226

to check the error.
Steven Schweda
Honored Contributor

Re: FTP Program advice

> Sometimes the ftp program is failing and we
> don't know the reason of fail.

What do you do? What happens when it fails?
"is failing" is not a useful problem
description.

> Is ftp return any exit codes of fail?

Most programs emit error messages when they
fail, or exit with some failure status. What
does yours do? Are you looking at what it
does? What makes you think that some other
program will tell you more than this one
does?



> [...] | grep 226

What happens if you get some other error
code?