Issue
I run a job using nohup & and get job id xxxxx. By using the command jobs -l I can see my job and it's associated id while in the same session. However, when I close my putty session and open a new session jobs -l no longer returns my job. How can this be corrected?
I know for certain the job is still running because file sizes as a result of the job keep growing (working with half a billion rows of data).
Solution
According to Linux Server Hacks, the answer is "no", you cannot reconnect in this scenario: the parent process has died. If you had done this from screen
or tmux
, then reattaching to those sessions would give you back the parent process.
As an alternative, you can attach to your process with a debugger such as gdb
, or a tool such as strace
. That aspect has been covered in other questions:
- How to open process again in linux terminal?
- How to view the output of a running process in another bash session?
- How to attach terminal to detached process?
Answered By - Thomas Dickey