Basic Screen Usage
Screen allows you to crate extra 'screens' which you can then execute processes in. You can switch between open screens and 'detach' screens, making it possilbe to 'reattach' them somewher else. This means you can be working on the server in a screen on one computer in an ssh session. Then you can detach the screen and connect on another computer to exactly the same terminalscreen you left off to.
It also means that even when you are gone, or not connected through ssh, processes will continue to run. Your minecraft server is run in a screen, because otherwise, as soon as you disconnect the terminal session will terminate and all the processes running in that session will stop. Meaning your minecraft server will stop.
It is also reccomended when making large downloads, to use a screen, because it ensures that even if the ssh connection terminates for some reason, your download will continue.
Create a new screen with that name.
$ screen -S nameDeattach the current screen and make it essentially run in the background
ctrl-a dReattach the deattached screen. If you have multiple deattached screens, you have to specify the PID. Now lets look at some practical usage schenarios:
screen -r [pid]
Running a minecraft server in a screen:
Create the screen:
$ screen -S minecraftServerstart the minecraft server (instructions for creating a start.sh file like this are avalaibe at this guide):
$ cd minecraftServerFolder
$ ./start.shdeattach the screen:
ctrl-a dNow, the minecraft server will run in the backgroud normally untill either the VPS stops, the process is stoppped or you reattach the screen and stop the minecraft server. If you need to do matenance on the server or use the console, you can reattach the screen by running:
$ screen -rthis will once again open the console for you to access.
Running a download in screen:
Create the screen:
$ screen -S ImportantDownloadChoose directory and start the download:
$ cd DownloadDirectoryNow when the download is finished, do this to close the screen:
$ wget "http://www.largefiles.net/verylargefile.txt"
Was this answer helpful?
A start.sh file allows you to easily start your minecraft server from a terminal prompt, without...
Download PuTTY Download PuTTY from the website. After you download PuTTY, launch the...
A Secure Shell (SSH) client allows you to connect to your Virtual private Server (VPS) and...
Mac OS X has a built-in SSH client called Terminal which can be used to connect to remote...
Powered by WHMCompleteSolution