Operating System - HP-UX
1833537 Members
3029 Online
110061 Solutions
New Discussion

ftp connection timed out by remote host

 
BKUMAR
Frequent Advisor

ftp connection timed out by remote host

Hi Big Brains !

i am getting a problem in ftp..when i transfer files from my laptop - remotely....between unix box to NT (shared folder)...i got copied several folders from unix servers....couple of folders having more than 350 files with around 500 MB capacity....i am unable to transfer at one sequence....i loose the connection saying

connection timed out by remote host....

since there are no of files i have to calculate/split and then transfer....i need a soln...to automate...since it is going to be a regular task fortnightly...i use the following
ftp>prompt off
ftp>hash
ftp>mget *

Note : i transfer the files in root user...no permissions problems also....i made a ping of unix server from my laptop during ftp....i find time<10ms...and Reqest timed out 1 time....coming between few intervals...i took lot of time to make this happen this time...i request your goodself(s) to give me a soln.

Thx
Unix Administration Most Dedicated and Challenging Career in the World
4 REPLIES 4
Krishna Prasad
Trusted Contributor

Re: ftp connection timed out by remote host

I have had a similar problem when sending several files between Unix and NT at once. The problem is always the NT service for FTP will end up failing becuase it can not keep up.

What I did is write a small script on the Unix side that looped through the directory and sent them one at a time....and sometimes had to add a sleep to the script in between the ftp's to make sure the NT side doesn't get over ran.
Positive Results requires Positive Thinking
Deepak Extross
Honored Contributor

Re: ftp connection timed out by remote host

Hi,
I can't say why your connection was breaking, but I did face the same problem many moons ago.
I had written a small script to
1. initiate the ftp session
2. after the ftp session terminates, compare the file sizes of the source and destination files
3. if different, 'reget' incomplete files - if you've already got 8MB of a 10MB file, this will only fetch the remaining 2MB.
4. once again, compare the file sizes. continue till all files are ftp'd successfully
The number of retries is configurable, the only hitch is that the password is stored in a temp file in plain text.
I'm attaching the script I have. You may want to tweak it a bit, maybe incorporate 'expect' to avoid compromising root password.
Or maybe just create a 'ftpuser' account, which wont do much damage if its password is compromised.

Caveat: I've never run this as root; do so at your own risk :
Steven Sim Kok Leong
Honored Contributor

Re: ftp connection timed out by remote host

Hi,

Just a hunch. Perhaps you can try to tune the network tunable parameter tcp_keepalive_interval via ndd to extend the timeout period when no ACK has been received by the remote system.

If the keepalive packet is not acknowledged by the remote system after the keepalive interval, the connection will be terminated.

The default is 2 hours.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Deepak Extross
Honored Contributor

Re: ftp connection timed out by remote host

Well, I *just* learned that I could have avoided writing the password to a temp file by using a 'here' tag like so:
ftp << END
open $hostname
user $user $pass
.
.
END
(vive la forum!!)

Maybe you should do this if you're running the script as root.