E
E
Ernest Faizullin2016-08-25 16:00:59
linux
Ernest Faizullin, 2016-08-25 16:00:59

How to correctly transfer all cron tasks under the control of Supervisor (linux)?

There are a lot of cron tasks on the server. To have control over them and have them (crowns) restart on error, many people advise Supervisor. I installed it according to the instructions, but I'm not sure that everything is correct now
. Let's say I have the following task in the crown:

* 0 * * * /usr/bin/php /var/www/mysite.com/cli/cli.php -a update-tickets

I also created the following config for the supervisor (for a process that is already in the cron):
[program:update-tickets]
command=/usr/bin/php /var/www/mysite.com/cli/cli.php -a update-tickets
process_name=update-tickets
priority=1
numprocs=2
numprocs_start=1
autorestart=true

Will this process be constantly monitored by the supervisor now? If not, how can I make the Supervisor constantly monitor all the crons?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2016-08-25
@erniesto77

Supervisor is not Cron, it has other tasks.
A cron task is not a service.
What you are recommended is from the area of ​​\u200b\u200b"scrub" and use the supervisor and its TICK_* events, but this is a bit of a path to the dark side :)

D
Dmitry, 2016-08-26
@zmitrok62

You can implement the control mechanism in the task scripts themselves. Those. if everything is OK - recorded in the log. If everything is bad - sent mail ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question