-
Notifications
You must be signed in to change notification settings - Fork 4
screen
screen
is very valuable: it allows you to launch a long-running job in the terminal on quest, detach from it and let it run in the background, while you close your computer or launch other commands.
basic usage:
-
screen
will launch a new terminal session - start your long-running script
- type
Ctrl-a
followed byCtrl-d
to detach from the session and return back to the original terminal -
screen -ls
will tell you which screen sessions are running -
screen -r
orscreen -r <session>
will restore you to a given session -
exit
orCtrl-d
will close a session when you're done
more info on screen
could be found here: https://linuxhandbook.com/screen-command/
quest specifics:
screen session is bound to the login node from which you start it. When you connect to quest, you end up on 1 of the 4 login nodes at random. They are called quser21
, quser22
, quser23
and quser24
. To restore a specific screen session, you need to connect to the login node where this session is. You can connect to any node from any node by typing ssh <node>
, for example ssh quser23
to survey which sessions you have across all the login nodes, you can use a small script:
- add
~/bin
to your path:hb="$HOME/bin"; if [[ "$PATH" != *"$hb"* ]]; then echo -e "\n\n# adding home bin to \$PATH\nexport PATH=\"\$PATH:$hb\"\n" >> ~/.bashrc; . ~/.bashrc; fi
- install the script:
mkdir -p ~/bin && wget "https://raw.githubusercontent.com/NUPulmonary/utils/master/bash/screen-status" -O ~/bin/screen-status && chmod +x ~/bin/screen-status
- use it:
screen-status
- example output:
$ screen-status
quser21
There are screens on:
10620.sn-ct-ipf-covid (Detached)
4322.hohoho (Detached)
quser24
There are screens on:
6262.serious-scripts (Detached)
4421.pts-226.quser24 (Detached)