문제

I made a python script running on background:

nohup python app.py &

then close the terminal, a few days later, I want to see this job, so I run

jobs

there list no jobs, but I'm sure the script app.py is still running.

도움이 되었습니까?

해결책

jobs will only give you a list of process running under the session group of the bash shell. nohup processes run in their own session group. There are a number of simple commands you can run to check if your nohup'd process is still running, the simplest being lsof | grep nohup (this command may take a few seconds to run)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top