0

Hi,
I have a python script that I run everyday at 00:00 as a cronjob & its lasts for about 5-6 hours. I want supervisor to monitor the script & restart if it hangs/crashes in the middle.

I have done something like this:

[program:python_script]
command=python run.py
directory=/home/user
stdout_logfile=/home/user/py_out.log
redirect_stderr=true
autorestart=true

This works but the only problem is it tries to restart the even after the completion of the script. What should do to check if the script has completed execution or crashed in the middle. I want supervisor to run only if it crashed.

Is there anything I can do in python script that signals supervisor that it has completed execution, so, supervisor don't have to restart it again?

Thanks for any help.

2
Contributors
1
Reply
14
Views
1 Year
Discussion Span
Last Post by cereal
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.