I started offloading some of the heavy-lifting and the more time-consuming jobs to my server. While I am more and more comfortable of using the ssh terminal, the mayor problem was that scripts only worked as long as I was logged in. Which goes completely against the whole idea of laying off work to the server. After some goggling I found the small tool “screen” which is available for linux. A more comprehensive introduction can be found here, but after installing I only used three commands: “screen” to start; “screen -ls” to list the open terminals after reconnection, and “screen -r XXX” to reconnect to a running terminal.
Installation
With my Linux (ubuntu) server all I had to do to install it was a simple
$ sudo apt-get install screen
Use
After that you can start screen by simply typing:
$ screen
Now start your time-consuming job and just quit the terminal whenever you can’t stand waiting any longer. Whenever you want to have a look again just connect via ssh, and get a list of open screens:
$ screen -ls
this gave me:
3467.pts-0.MYSERVER (09/14/2011 08:59:46 PM) (Detached)
2238.pts-0.MYSERVER (09/14/2011 08:45:13 PM) (Attached)
2 Sockets in /var/run/screen/S-gerhi.
To reconnect to the first of these still running terminals, you just enter:
$ screen -r 3467.pts-0.MYSERVER
One Response to Keep ssh-scripts running without a connection – “screen” for Linux
Leave a Reply Cancel reply
Tags
annotation audio editor audio player Befragungssoftware Datenanalyse Einführung experiment software fun GIS Graphics gui JabRef LaTeX Literatur Literaturverwaltung Online-Befragungen Online survey software operating systems Organisation Problembehebung psytoolkit Python R reference manager Renglish Scienceadmin Sicherheit signal analyis simulation software Statistik traveltime video player website writing-up









[...] from the blog Sustainable Research posted a nice article about the screen-command for the linux console that allows you to run scripts in the background [...]