I am using putty to interact with Linux server. I have started a process using putty. The process is running and will take 5-6 hours. I want that process to keep running after I close the putty session. How can I keep that process alive after closing the putty session? I do not want to keep the computer ON all the time. Is there any way to do this?.
I use screen for that kind of stuff. Actually sometimes I just leave it on quite a while so I can get back to what I was doing.
^Z bg %1 disown -h %1
The '-h' makes the process immune to SIGHUP when the session completes.
nohup command. Just prefix it to your command and it will daemonise them so that they won't stop when you log off/terminate your shell session. The standard output will by default be in a file called nohup.out. Check the manual page for
nohup(1) for more information.
Start process with
nohup "processname" &.
You can also detach it with
The above solutions are quite well described, however, none of them worked for me UNTIL I also edited PuTTY configuration to :
Enable TCP keepalives (SO_KEEPALIVE option)
I hadn't seen this anywhere else, and just found it by trial and error.
Ctrl+z Send the current process to the background.
Also, you may add & at the end of your command to run in in background
If you want the program that is contained in the process to always or frequently run in the background, you can code it to separate from the controlling terminal (make such behaviour controllable via an option flag) and run in the background.
That's a long term solution, of course, not for the currently running process.
You can use
& after the link.
[localhost ~ ]# wget http://www.link.com/download/download.zip &
How to keep weblogic running after closing putty window:
Simple Steps: after the login through putty follow the below steps:
- Go to the directory on the server where the
startWebLogic.shcommand is located.
- Type command
screenand press Enter (a new screen will open).
- In the new screen type your run command
- Press Ctrl+a then press d (without holding Ctrl); you will return back to the previous screen.
- When you want to return to your server log screen, type command