3

I was trying to use nohup like that:

 nohup python fibo.py & > a.out 

When I do so and try to exit from the shell it prompts that "you have running jobs". But that should not be the case.

$ nohup python test.py & > a.txt [1] 21608 $ nohup: ignoring input and appending output to ‘nohup.out’ $ jobs -l [1] + 21608 Running nohup python test.py & > a.txt $ exit You have running jobs 
3
  • 1
    How were you trying to use nohup exactly? What was the invocation? What is the output of the jobs command? Commented Feb 2, 2018 at 22:01
  • If you are just launching the command with nohup your_command and than use ctrl+z to send it to background it may say that it is already running. You can use bg after that to properly send it to background or better use correct nohup syntax in the first place: nohup your_command & Commented Feb 2, 2018 at 22:08
  • I used the command nohup python fibo.py & > a.out Commented Feb 2, 2018 at 22:10

1 Answer 1

7

When you run

$ nohup some-command & 

there is a job running in the background until some-command exits. nohup only disconnects the command from the terminal; disown removes it from the jobs list. It seems to me your intended syntax is

$ nohup python test.py > a.out & disown 

Note that the syntax used in the question has > a.out after the & that ends the command. This means that the output of test.py is not being sent to a.out — instead, it is being appended to nohup.out as the message indicates.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.