I have a bunch of servers, on which I run experiments using screen
. The procedure is the following :
ssh
to server XXX- launch
screen
- start experiments in a few tabs
- detach
screen
- disconnect from the server
While the experiments are running, I can easily find on which servers they are by ssh
ing to all servers and listing my running processes (using top
or ps
).
However, once the experiments are finished, how could I find on which servers I have a screen session opened (so that I can have a look at the output, relaunch them, etc.) ?
PS: my experiments do print their output to files, too... but this is not the point of my question.
So you're using screen to keep the experiments running in the background, or what? If so, why not just start it in the background?
And if you're asking how to get notification the job i done, how about stringing the experiment together with a mail command?
to see what is that screen running in case you used the command
To list all of the screen sessions for a user, run the following command as that user:
To see all screen sessions on a specific machine you can do:
I get this on my machine:
This is a rather brilliantly Unixy use of Unix Sockets wrapped in filesystem permissions to handle security, state, and streams.
The command screen -list may be what you want.
See the man
While joshperry's answer is correct, I find very annoying that it does not tell you the screen name (the one you set with -t option), that is actually what you use to identify a session. (not his fault, of course, that's a screen's flaw)
That's why I instead use a script such as this:
ps auxw|grep -i screen|grep -v grep
I'm not really sure of your question, but if all you really want is list currently opened screen session, try: