cancel
Showing results for 
Search instead for 
Did you mean: 

script

 
navin
Super Advisor

script

Hello
when work remotely my unix secure crt session becomes hung after 30 min inactive session.can some one tell me a small script that can keep my session alive.
any idea is welcome
thanks
Learning ...
6 REPLIES
Ganesan R
Honored Contributor

Re: script

First you should identify if the session get hung or disconnected.

If it is getting disconnected then you need to look at the timeout(TMOUT) value.

The easiest one would be ping the server.
Best wishes,

Ganesh.
Johnson Punniyalingam
Honored Contributor

Re: script

Hi Navin,

you try by nohup , by running you script back round.

Example:-

vi osbackup.sh
make_tape_recovery -AvI -x inc_entire=vg00 -a /dev/rmt/0mn

# nohup ./osbackup.sh &

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Mel Burslan
Honored Contributor

Re: script

More than likely, the network connectivity between your windows workstation (you said secureCRT right ? running on windows ?) and the server your are connecting to is dying because of the firewall/router timeout settings. And there is not much you can do about it unless you are the network admin at the same time. In most environments, security rules mandate to kill inactive sessions after certain time. Looks like yours is set to 30 minutes.
Talk to your network admin and see if the timeout value can be extended.
Also, sometimes, leaving a vi session open on the terminal prevents the timeout taking effect but not always. You definitely can try that.
Or, also something like this can keep your connection alive but again, not always:

while true ; do
echo "I'm alive"
sleep 60
done

I said not always, because some routers/firewalls, look for bidirectional activity to stay alive not unidirectional.

The only thinl that you can do is to record a windows macro of some sort (autohotkey windows program comes to mind to accomplish this) and send the command "ls" to your unix terminal window every few minutes, definitely more frequently than 30 minutes to prevent the timeout.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Md. Farhan A Azam
Trusted Contributor

Re: script

Hi,

A small suggestion..hope it will work.

First login in the server through Secure CRT..Then click on - Options or Alt+o - Session option or Alt+s.
A session Option page will appear..in this page again click on Options and in right side pane check the "send string" box and give -. And also check the attchement.


Thnx...Farhan
Tingli
Esteemed Contributor

Re: script

run top, or glance.
Mel Burslan
Honored Contributor

Re: script

I am not sure what your reason is to use secureCRT but if you want to save some money for secureCRT licensing and switch to putty instead, under the connection settings, there is a box where you can specify how many seconds that you need to send a keepalive signal to the server. It is turned off (zero) by default but you can change it.

Just an idea.
________________________________
UNIX because I majored in cryptology...