Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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...
Admin.SIF
Frequent Advisor

Re: ftp

Hi Paula,
we know the reason of our problem : we have deconnected the NT server during the transfer and we had done this to see what will do the script. We are looking for a solution that would stop completely ftp in case of a problem like the one we have generated or any other problem during the transfer.
(Basically, we want the script to terminate with # or $ not ftp> whith no connection)

Nora
Sysd. Amin. Inforef