Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started an big operation, but I didn't start a screen session, So i can't disconnect without canceling the operation.

Is there a way to inject screen so that the operation continues and sends its output to the screen session and i can safely disconnect my ssh session?

share|improve this question

Short answer is no. Long answer is maybe. Good luck.

share|improve this answer
up vote 2 down vote accepted

After browsing your "No." link I actually found this answer on serverfault from earl:

However, for your actual problem, there's another thing you could try: after having launched your job from the terminal, background it by typing ctrl-z and then bg. After that, detach the job from it's parent shell - in bash: disown -h %. After that, you can safely close the terminal and the job will continue running.

And this one from the same question from Rob Wells:

$ screen -S my_process
$ retty $(pgrep my_process)

share|improve this answer
In the linked question, reptyr worked better than retty for me. retty detached but wasn't able to reattach. – Leons Jul 9 '14 at 21:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.