0

Say I'm running a task on a remote (Ubuntu) server which last hours, but I need to disconnect my shell client now. Foolishly, I didn't use screen or think of starting the task with nohup.

Is there a way to perhaps pause the task, then start it up in the background so it will continue even with my terminal disconnected?

1 Answer 1

3

If you're not interested in the output, you can use Ctrl-Z and then bg to run the task in the background, and then disown to stop the shell sending it a SIGHUP when you disconnect.

5
  • Awesome. I didn't know about disown. Weirdly it doesn't have a man page or any help. Jun 7, 2012 at 8:46
  • And out of curiosity - if I am interested in the output? Jun 7, 2012 at 8:46
  • On RHEL man disown opens BASH_BUILTINS(1) which has a bit more information.
    – Bram
    Jun 7, 2012 at 9:56
  • If you are interested in output, you could start screen and use something like reptyr to reparent it.
    – nickgrim
    Jun 10, 2012 at 21:09
  • This explains it more: serverwatch.com/tutorials/article.php/3935306/… Sep 4, 2013 at 3:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .