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?

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

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


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

  • - 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy