I am working on a remote Debian Jessie server. I have started a screen session, started running a script, then been disconnected by a network timeout.
Now I have logged in again and want to resume the session.
This is what I see when I list screens:
$ screen -ls
There are screens on:
30608.pts-8.myserver (11/03/2015 08:47:58 AM) (Attached)
21168.pts-0.myserver (11/03/2015 05:29:24 AM) (Attached)
7006.pts-4.myserver (10/23/2015 09:05:45 AM) (Detached)
18228.pts-4.myserver (10/21/2015 07:50:49 AM) (Detached)
17849.pts-0.myserver (10/21/2015 07:43:53 AM) (Detached)
5 Sockets in /var/run/screen/S-me.
I seem to be attached to two screens at once.
Now I want to resume the session I was running before, to see the results of my script:
$ screen -r 30608.pts-8.myserver
There is a screen on:
30608.pts-8.OpenPrescribing (11/03/2015 08:47:58 AM) (Attached)
There is no screen to be resumed matching 30608.pts-8.myserver.
Why I can't I re-attach?
I have the same problem with the other screen:
$ screen -r 21168.pts-0.myserver
There is a screen on:
21168.pts-0.OpenPrescribing (11/03/2015 05:29:24 AM) (Attached)
There is no screen to be resumed matching 21168.pts-0.myserver.
screen -x
,screen -rd
is to attach to it after having detached it from every terminal it was attached to. In the case of the OP, I'd agree the latter is probably prefered, but in the general case, not necessarily. I generally use-xR
to attach or create if there's nothing to attach. – Stéphane Chazelas Nov 07 '15 at 21:56