LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set ssh/putty session running in disconnected mode (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-ssh-putty-session-running-in-disconnected-mode-890429/)

aamerjavaid 07-07-2011 09:00 AM

how to set ssh/putty session running in disconnected mode
 
Hi All,

How can we put ssh/putty session running even after in standby or disconnected mode.

The idea is to have run a long running job from my notebook, which may take 6-8 hours, and if i come next day, there should be interrupt with it.

Regards,
Amir

ichase 07-07-2011 09:46 AM

Not sure this or anything will work with the server in standby mode but here is a workaround to Keep Your Linux SSH Session From Disconnecting.

Hope this helps,

Ian

lithos 07-07-2011 10:41 AM

I think what you might need is Screen (or link here)

good luck

michaelk 07-07-2011 10:45 AM

I assume the OP means if the client is disconnected from the server.
The screen command will allow the client to disconnect without the running process being stopped.

http://www.linuxjournal.com/article/6340
http://www.rackaid.com/resources/lin...al-and-how-to/

To late...

sandwormusmc 07-07-2011 12:33 PM

Quote:

Originally Posted by aamerjavaid (Post 4407853)
Hi All,

How can we put ssh/putty session running even after in standby or disconnected mode.

The idea is to have run a long running job from my notebook, which may take 6-8 hours, and if i come next day, there should be interrupt with it.

Regards,
Amir

If you're trying to keep the SSH connection from disconnecting, try the link iChase posted. Otherwise, check out screen (from lithos' post) or the "nohup" command.

I haven't used screen that much so can't comment on that, but nohup is pretty easy. Simply put "nohup" before the command and it will continue to run even if the session is disconnected.

Code:

# nohup somecommand
nohup: ignoring input and appending output to `nohup.out'

This will keep the command running and put all of the results to a file called 'nohup.out' in your current directory ...

chrism01 07-07-2011 07:21 PM

Re nohup; I usually use
Code:

nohup /dir/prog > /dir/prog.log 2>&1 &
dir spec may be optional depending on your PATH and where you want the log

aamerjavaid 07-07-2011 11:17 PM

Thank you all,
I will try to implement these, and hopefully update you soon.

Regards,
Amir

sandwormusmc 07-08-2011 08:53 AM

Quote:

Originally Posted by chrism01 (Post 4408347)
Re nohup; I usually use
Code:

nohup /dir/prog > /dir/prog.log 2>&1 &
dir spec may be optional depending on your PATH and where you want the log

Good call. Otherwise all of the error info (everything on stderr) won't be seen.


All times are GMT -5. The time now is 11:44 PM.