Pregunta

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.

¿Fue útil?

Solución

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)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top