2

Possible Duplicate:
Can I nohup/screen an already-started process?

GNU screen is great for long running programmes. You can start your programme in it and disconnect and bring your laptop home.

However sometimes I start a programme outside screen and it takes longer than I want. I have no problem with pausing the programme using Control - Z etc., however I don't want to restart it cause then it'll take ages to run again. Is there some way I can move an existing running process into a screen session?

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
  • 3
    Dupe: http://serverfault.com/questions/24425/can-i-nohup-screen-an-already-started-process – Murali Suriar Aug 04 '09 at 16:50
  • 1
    Yes you can. Reptyr was made just for that purpose: http://serverfault.com/a/284795/235596 – newUserNameHere Sep 27 '14 at 18:31
  • Not dupe of http://serverfault.com/questions/24425/can-i-nohup-screen-an-already-started-process , but is dupe of http://serverfault.com/questions/55880/moving-an-already-running-process-to-screen/284795 As @newUserNameHere mentioned, reptyr is a good solution which is a possible solution to both problems, but still different kind of questions. – NiKiZe Jan 06 '17 at 23:02

2 Answers2

2

I think the answer is "no".

After having some horrible experiences with poor wireless connectivity and long-running processes, I reflexively run EVERYTHING in screen sessions now. My first command on connecting to a system is nearly always

$ screen -ADR

...and I go from there.

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77
0

No, sorry, you can't.

Furthermore I do the same as David Mackintosh. Where ever I am, I start my screen (although I use screen -x). Almost everything I do on my server is running inside my screen, with about 20 screen windows open.

In that case, it will not mind if something is taking a bit longer.

blauwblaatje
  • 953
  • 1
  • 6
  • 19