1

I am running a long python process on a Amazon Web Service shell, say it is

python sample.py

When I exit the shell, it will kill the process, so I tried putting it in the background with nohup python &.

I exited the shell and when I came back, I typed ps -ef | grep python, and the process was still there, however it was no longer printing any output (the job keeps writing output). I tried fg <job_number> and I got "no such job".

The result for ps -ef | grep python is

ubuntu    2433     1 81 02:55 ?        00:01:53 python sample.py

Is the process still running? How do I keep checking its output?

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
user
  • 2,015
  • 6
  • 22
  • 39
  • 3
    The nohup.out file in the directory you executed it. – jordanm May 23 '16 at 03:07
  • Fantastic! It was so simple. If you make it an answer I will accept it. – user May 23 '16 at 03:13
  • Possible duplicate of [What are the alternatives to "python3 sample\_program.py &" via ssh?](http://stackoverflow.com/questions/36510091/what-are-the-alternatives-to-python3-sample-program-py-via-ssh) – Jakuje May 23 '16 at 15:24
  • Actually, that question is different. I know how to exit and keep the program running, but I did not know how to look at the running program after I am back in. – user May 23 '16 at 18:29
  • why not use screen/tmux or others? – AndreiR Feb 17 '17 at 12:54

0 Answers0