Operating System - HP-UX
1823748 Members
4051 Online
109664 Solutions
New Discussion юеВ

Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

 
Charles Gaffney_1
Occasional Advisor

Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

Smart People:

I have a cron that will FTP certain files every morning. If the file is small it will FTP with no errors. However, a listing on the destination server shows a zero byte file. If I FTP it manually it will be 0 bytes two or three times, then it will be fine two or three times.

This is a major headache? Is there anything I can do to negate this?
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

Few thoughts:

1) make sure you have the latest wu-ftpd server from software.hp.com

2) Is the target filesystem full, or close to full.

3) kernel on the target box, nproc, nfiles parameters, may need upward adjustment.


4) Check the file /var/adm/syslog/syslog.log on the target box when this happens.

Report back,

Have fun.

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
A. Clay Stephenson
Acclaimed Contributor

Re: Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

Your fundamental problem is that you are not testing the result of the FTP transfer. Even very robust FTP fails on occasion; it's simply the nature of the beast. By all means check for speed/duplex mismatches, patches, etc. BUT the fundamental problem remains --- you are not testing the success of the transfer and it's not easy using typical shell scripts.

Use the Net::FTP Perl module and things are trivially easy. If you are using HP-UX 11.11 then the lastest Perl already has Net::FTP installed but otherwise you will need to download and install the module from www.perl.org/CPAN.

The attached script will transfer a file and automatically retry up to 5 times. It puts the files in the /tmp directory on the remotre host in ascii mode. Modify to suit your needs.

You would use it like this:
ftpput.pl file1 file2 file3
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "OK"
fi

If it ain't broke, I can fix that.
Charles Gaffney_1
Occasional Advisor

Re: Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

Thanks.

I do check the files. It retried 45 times this morning and still had the zero byte file on the other end.

Other end is a Windows2k server running Serv-U
Cary Farah
Frequent Advisor

Re: Small Files from HPUX Turn Up 0 Byte on FTP Serv-U

can you try using paasive mode
login to ftp server
then type
ftp> passive
and transfer the file
ftp> put xxxx.file
ftp> ls -l
list the files on ftp server
does the file have bytes size to it , i betting it will..

(I dont know what the fix is to default passive mode to on.)