I
I
Ivan2016-07-20 17:24:34
CentOS
Ivan, 2016-07-20 17:24:34

How to run python script automatically?

Hello. Faced with a problem. After rebooting the server, the python script does not start.
I registered it in rc.local, also in supervizor.
After the reboot, the process can be found with
ps aux | grep prog
There is a pid, running as root. But there are no signs of life. Axis centos 6.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Nikolaev, 2016-07-20
@nightvich

Use cron .
The @reboot construct is used to run the cron script after the server is rebooted. Add to our crontab:
@reboot sh /path/to/your/your_program
Example with a delay of 60 seconds:
@reboot /bin/sleep 60 ; sh /path/to/your/your_program

D
Dimonchik, 2016-07-20
@dimonchik2013

admins start
programmers with cron - Celery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question