GNU Screen is one of the coolest command-line tools that most people have never heard of.
One of the many useful things that it can do is provide a simple way to write a server
application. You just take your program and run it inside of screen. This allows you to
start your server and then disconnect the program using screen’s command:
Then anytime you want to reconnect you type:
to find your session (which you could name) and then you use
screen -R session_number
to reconnect and do things on your program.