LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2011, 09:00 AM   #1
aamerjavaid
Member
 
Registered: Dec 2005
Posts: 53

Rep: Reputation: 15
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
 
Old 07-07-2011, 09:46 AM   #2
ichase
Member
 
Registered: Jul 2010
Location: Virginia Beach, Virginia
Distribution: Arch
Posts: 67
Blog Entries: 4

Rep: Reputation: 3
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
 
Old 07-07-2011, 10:41 AM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
I think what you might need is Screen (or link here)

good luck
 
Old 07-07-2011, 10:45 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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...
 
Old 07-07-2011, 12:33 PM   #5
sandwormusmc
Member
 
Registered: Nov 2006
Distribution: Fedora 15 x86_64
Posts: 76

Rep: Reputation: 24
Quote:
Originally Posted by aamerjavaid View Post
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 ...
 
1 members found this post helpful.
Old 07-07-2011, 07:21 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
Old 07-07-2011, 11:17 PM   #7
aamerjavaid
Member
 
Registered: Dec 2005
Posts: 53

Original Poster
Rep: Reputation: 15
Thank you all,
I will try to implement these, and hopefully update you soon.

Regards,
Amir
 
Old 07-08-2011, 08:53 AM   #8
sandwormusmc
Member
 
Registered: Nov 2006
Distribution: Fedora 15 x86_64
Posts: 76

Rep: Reputation: 24
Quote:
Originally Posted by chrism01 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I launch a complete Gnome desktop session using SSH via PuTTY? linuxinvasion Linux - General 9 06-05-2011 10:39 AM
Suspend ssh session using putty linuxmandrake Linux - Software 3 07-05-2010 09:33 PM
Running GUI from SSH session amirsd Linux - Newbie 2 12-07-2009 12:20 PM
viewing an ssh session that is already running? arya6000 Linux - Newbie 2 06-28-2009 05:10 PM
Running lg3d in session mode f3ua Linux - Software 0 11-15-2005 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration