How can I track a job that is still working (I think it's disconnected?) After I started it with nohup, logged out of the server and logged in? I usually use jobs -l to see what works, but it shows an empty one.
jobs -l
You need to understand the difference between a process and a task . Tasks are managed by the shell, so when you end a terminal session and start a new one, you are now in a new instance of Bash with your own task table. You cannot access tasks from the original shell, but as other answers noted, you can still find and manage running processes. For instance:
$ nohup sleep 60 & [1] 27767 # Our job is in the jobs table $ jobs [1]+ Running nohup sleep 60 & # And this is the process we started $ ps -p 27767 PID TTY TIME CMD 27767 pts/1 00:00:00 sleep $ exit # and start a new session # Now jobs returns nothing because the jobs table is empty $ jobs # But our process is still alive and kicking... $ ps -p 27767 PID TTY TIME CMD 27767 pts/1 00:00:00 sleep # Until we decide to kill it $ kill 27767 # Now the process is gone $ ps -p 27767 PID TTY TIME CMD
You can track if processes, if they are still running, using
ps -p <pid> , where is the process ID that you get after using the nohup command.
ps -p <pid>
nohup
If you see that the valid records you are processing are probably alive.
You can have a list of processes running under the current user using ps -u "$USER" or ps -u "$(whoami)" .
ps -u "$USER"
ps -u "$(whoami)"
Try the following:
ps -ef | grep <pid>
Source: https://habr.com/ru/post/1496895/More articles:Make Django not a lazy module, for ease of development - pythonClearing attributes in Tritium - attributesdjango dumpdata empty array - pythonWhich regular expression will detect if a string is part of a numbered list? - javascriptConfusion between BehatContext and MinkContext - symfonyWhat is wrong with my FeatureContext? - phpnode -gyp configure build error - node.js"javac" was not found and could not be manually located in C: \ Program File (86x) \ Java \ jre7 \ bin - javacAnnotating page links using jQuery - jqueryHow to use: author in jekyll permalink structure for github pages - github-pagesAll Articles