I know you can use
nohup to keep a job running after logging out, but what about a process that's already running?
Is there a way to change it's state, so that it continues to run even when I log out?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
In Bash, you could
disown the process.
disown [-ar] [-h] [jobspec … ]
jobspecis removed from the table of active jobs.
-hSIGHUP is not sent to the job if the shell receives a SIGHUP. current job .
See also: Shell stuff: job control and screen
If you use the bash shell, then you have an alternative (don't you always?) Instead of using nohup, just run the command normally, put it in the background one of the two ways we've discussed, and then disown -h the job.
$ tar cjf /backup/rob/home.tar.bz2 . &  32089 $ disown -h
You can then safely logout or close your terminal. As with nohup, if you close the terminal or logout, you will not be able to access that command directly using the jobs and
Related posts on the Stack Exchange network: