D
D
Dant1212020-06-19 14:14:13
FreeBSD
Dant121, 2020-06-19 14:14:13

How to make the service restart every hour through crontab?

There is billing, it has agents, and here is one agent that collects telephony, periodically freezes and stops collecting statistics, while its status is working. The company that supplied the billing said that they were working on the problem, but until it was resolved, I decided to restart it once an hour. I'm not on you with freebsd, but searching the Internet through crontab - e did the job

[[email protected] /usr/local/etc]# crontab -l
0       *       *       *       *       root    /usr/local/etc/rc.d/LBphone.init restart

For the test, I made it run every minute
[[email protected] /usr/local/etc]# crontab -l
*       *       *       *       *       root    /usr/local/etc/rc.d/LBphone.init restart

I stop the service, and it does not restart, how to do it right so that the service restarts once an hour?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
K
Karpion, 2020-06-19
@Karpion

First you need to look at what is inside /usr/local/etc/rc.d/LBphone.init and check if this script works at all.
By the way, it is not at all a fact that the restart key is able to start a stopped service; up to the point that this key may not be supported at all. Again - you need to look inside the script, what is being done there.
Well, it would be nice to look at the logs - both the crown and the system ones, and personally of this service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question