Issue
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.
Solution
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)
Answered By - Gearoid Murphy Answer Checked By - Terry (WPSolving Volunteer)