Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have got a little python program which I want to run on my remote sever(Ubuntu). But after closing the ssh-connection the program closes as well.

How do I keep this program running without the ssh-connection?

share|improve this question
    
Think perhaps you're probably either looking to daemonize your python script, or run process in the background? astro.ku.dk/comp-phys/tutorials/background.shtml –  James May 2 '13 at 22:15
add comment

2 Answers

up vote 1 down vote accepted

A couple of simple things to try -

  1. Add an "&" character to the end of the command line you are running which will background the job and will probably work or

  2. Use the "screen" program - run screen, then the command, then detach your console from screen.

share|improve this answer
    
Option 1 worked just fine. –  Stein May 2 '13 at 22:38
add comment

You could use the program screen. Once logged in to the SSH session, type:
screen -S (name)

Then start the process. Disconnect by typing:
Ctrl-A then D

When you want to re attach to this session, SSH back in and type:
screen -r (name)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.