1

I have to run a python script in the background in my server. I am using the command:

nohup python MyScript.py &

in the command line. Now, when after running this I close the connection and log out and log in back it fails, I see that its not running anymore. Any ideas?

EDIT I am using Putty software to log into my server and from there am trying it.

Akshay Bhasin
  • 11
  • 1
  • 3
  • 2
    I don't have a direct answer to your question, but it was because of problems like this that I started using the `screen` utility. Screen basically creates subshells and allows you to detach them from your current session. So in these cases you would load screen, start the script, detach your screen, log out. Then check back in a couple hours by logging on to the server and reattaching your screen. Check it out. – Safado Mar 04 '16 at 16:19
  • anything in nohup.out? – BeerSerc Mar 04 '16 at 16:20
  • @BeerSerc yeah the code is running corectly and I can seee it when I am logged in. But when I come back it was stopped. – Akshay Bhasin Mar 04 '16 at 16:23

1 Answers1

2

Try:

nohup python MyScript.py &
disown
cliimatta
  • 21
  • 1