1752794 Members
6209 Online
108789 Solutions
New Discussion юеВ

Re: ftp

 
Admin.SIF
Frequent Advisor

ftp

Hi,
please excuse my english.
We are using an ftp-script to put files from hpux box to windows NT.
Does someone have an idea how to terminate the session (bye/quit) after inactivity time set with idle, perhaps using status ??
Thanks,

Nora
Sysd. Amin. Inforef
10 REPLIES 10
Vincenzo Restuccia
Honored Contributor

Re: ftp

#!/usr/bin/sh
ftp -n << EOF
verbose
open thehost
user uuu ppp
get /tmp/stuff
close
EOF

I think close
James R. Ferguson
Acclaimed Contributor

Re: ftp

Hi:

You can add a timeout option (-t ) to the 'ftpd' daemon as started by 'inetd'. The default, is 15-minutes:

For example, to chnge the timeout to 5-minutes change the 'ftp' entry to look something like this in /etc/inetd/conf:

# ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -t 5

To enable the change, do this:

# /usr/sbin/inetd -c

...JRF...
Admin.SIF
Frequent Advisor

Re: ftp

Hi Vicenzo,
my question is : how to terminate the script if there is a problem before the close or bye or quit.
We receive : exiting on signal 14 but the session is still here without any connection.

Precison : the ftp-script is enclosed in another script which execute a lot of things, so if the ftp session is not terminated, the script can not continue.

Thanks,
Nora
Sysd. Amin. Inforef
Vincenzo Restuccia
Honored Contributor

Re: ftp

See in my script ftp session is terminated with close,otherwise bye or quit.
Vincenzo Restuccia
Honored Contributor

Re: ftp

Sorry,fix the timeout see the reply of James.
Admin.SIF
Frequent Advisor

Re: ftp

Please, see the precision in my second message.
Nora
Sysd. Amin. Inforef
Paula J Frazer-Campbell
Honored Contributor

Re: ftp

Hi

The following will automatically quit

------------------cut here-------------------
# Send the files to the new server
ftp -n 172.20.20.17 <user ftpuser sesamme
prompt
binary
mput *.BI
put REFRESH.FLG
quit
End_of_Ftp
------------------cut here-------------------


Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: ftp

Hi
I have just re-read your question.

Instead of putting fixes into scripts, investigate the reason for the "exiting on signal 14". Ntework problems ? server / network timeouts?


Paula
If you can spell SysAdmin then you is one - anon
Mark Fenton
Esteemed Contributor

Re: ftp

Nora,

Should we assume that your script that calls the ftp has to wait for the ftp session to finish before proceding, perhaps logging the success/failure of the session? If so, then I would think that James' solution should fix, as the session should time out waiting for activity.

If the script doesn't need to wait for the ftp session, then couldn't that portion be backgrounded while the rest continues? You probably already thought of that, though...