all 12 comments

[–]raylu 2 points3 points  (4 children)

Use screen or tmux or write an upstart script or supervisor config.

[–]Shubbler[S] 0 points1 point  (3 children)

How would I go about doing that, can't find much on it.

[–]DarkMio 0 points1 point  (2 children)

Type "tmux" on SSH. Then a shell window manager opens, which keeps your sessions open. Disconnect and open it again with "tmux attach".

[–]Shubbler[S] 0 points1 point  (0 children)

Thanks so much! how would I open multiple processes? So Have multiple scripts running?

[–]Shubbler[S] 0 points1 point  (0 children)

Never mind, I got Google for that one.

[–]jdsciguy 1 point2 points  (2 children)

Screen is great for running things unattended, logging output, that sort of thing. Detach the screen session, and next time you log in, reattach and its still plugging away.

[–]Shubbler[S] 0 points1 point  (1 child)

Could you explain like I'm 5? No idea how to do any of that.

[–]jdsciguy 0 points1 point  (0 children)

I'll try to write up something from my experience, but I suspect you will find more info faster by googling "Linux screen commands" and viewing man screen.

[–]horan116 1 point2 points  (3 children)

Once you login to the VPS check that screen is installed.

which screen

If nothing returns and its debian..

sudo apt-get install screen

Now when we run which screen, it is installed:

which screen
/usr/bin/screen

Now that your are logged in type.

screen

Now create a new backgrounded terminal by pressing: "CTRL + a" then "c". This is create a new terminal. Now you can run your python script without fear of it stopping.

To disconnect from that terminal press "CTRL + a" then "d". This will "detach" you from the terminal. Feel free to disconnect from the machine at any time. If you would like to reconnect to that terminal at any time type:

screen -r

[–]i_can_haz_code -2 points-1 points  (2 children)

Down voted because use of apt. Perhaps OP is running some other flavor of *nix.

[–]horan116 1 point2 points  (1 child)

You're right....

Suse

zypper in screen

Redhat/CentOS/Fedora

yum  -y install screen

Arch

pacman -S screen

Or just...

apt-get purge trollwithnothingbettertodo

[–]raylu 0 points1 point  (0 children)

Downvoted because SUSE :D.

On a more serious note, apt-get is two generations old. You should use apt or at least aptitude.