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 started a long running python script. It was supposed to be running for more than 4 hours. I have started the script in a background redirecting console output to some text file. I was monitoring the redirected output using "tail -f" for some time.

After that, I have closed the session. As the script execution was going in a background, it should have been continued till the end.

However, next day I was curios to know the results and somehow I did not find any traces of script execution. There were just few lines found in the text file. Those few lines were the lines which were redirected till the time when I was monitoring the file with "tail -f".

I had noted down the process ID (#30804) of python script execution. Can I find process traceback using Process ID?

share|improve this question
add comment

migrated from stackoverflow.com Jul 10 '13 at 3:19

This question came from our site for professional and enthusiast programmers.

1 Answer

Use nohup to allow a process to keep running after logging out. Or use screen to allow disconnecting and reconnecting to the login session.

share|improve this answer
    
- Yes you are right. But I tried with cron scheduler and unexpectedly the same thing happened with cron job. Very few logs are reported. However, manual execution of the script gives complete run and logs. –  Abhishek Kulkarni Jul 9 '13 at 4:05
    
That I can't explain so easily, sorry. –  Barmar Jul 9 '13 at 4:08
add comment

Your Answer

 
discard

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