See screen , which is a command line utility. Start with
screen
You will get a new shell that will be detached. Start your script with
ruby whatever.rb
And look how it works. Then press Ctrl - A Ctrl - D , and you will return to the original shell. You can leave the ssh session now, and the script will continue to work. At a later time, enter your block and enter
screen -r
and you must return to a separate shell.
If you use the screen more than once, you will need to select a screen session using pid, which is not so convenient. To simplify, you can do
screen -S worker
to start a session and
screen -r worker
to renew it.
moritz
source share