Error
  • JCacheStorageFile::_deleteFolderJLIB_FILESYSTEM_DELETE_FAILED

Screen - Getting started

See user ratings User Rating:  / 0
PoorBest 

Some time ago I read about a tool called "screen", it looked very useful, but I couldn\'t find much help.

Later I did find some, and have collected it here, together with my experience, and of course lots of help from the man-pages.

If you connect to your server using the usual ssh user@server, and start something that takes awhile, you will need to wait until the program finishes before you log out, otherwise the program stops, and your work is potentially lost :-(

 

The same applies, if the connection is dropped for any reason.

This is the reason for using screen.

Start by using ssh to connect to your server, this could be something like: ssh This email address is being protected from spambots. You need JavaScript enabled to view it. .1.5

If your server already has screen installed, you\'re in luck, otherwise you will need to install it the usual way, by tapping "aptitude install screen" or similar for your distribution.

When screen is installed try typing "screen".
Now the terminal will go blank. What really happened is that screen started in the background and started a frontend, which is the one that you have in front of you now.
The great thing, is that the backgroundprocess, is the one that actually runs all commands that you send to it. The result is that your session is not vulnerable to dropped connections. Cool ?

When you\'re done doing what you want, you can "detach" (means closing the terminal, without stopping your running programs), by pressing "<ctrl>-a" followed by "d".
You are now dropped back to your original ssh-session, this session can safely be left by the usual "exit".

When you want to resume your work, connect again using the normal ssh.
When you\'re logged in, start screen again, but this time by entering "screen -r", you can now see and work, just as you would have if you had stayed in front of the terminal the whole time.
You can even do this by connecting from any terminal anywhere in the world, as long as you can ssh to your box.

You can start screen more than once, if you choose to do that, you need to specify which screen session to connect to when reconnecting.
First you need to find out the ID, you do this by entering "screen -ls", this will produce something like:
3480.pts-0.serv01   (2010-12-13 21:11:07)   (Detached)

You can now reconnect to the right one (above I only have 1...) by connecting like this:
"screen -r 3480"
or
"screen -r 3480.pts-0.serv01"
If you have only 1 instance of screen running, you can even use
"screen -r"

This is very cool, you can have different sessions for different types of work :-)
But it can be even better, see you at next update, hopefully in a couple of days....

More will follow with more shortcuts and such.

Happy  screening :-)

Danjel