A
A
alxsmrn2016-05-20 18:19:01
Yii
alxsmrn, 2016-05-20 18:19:01

How to run YII2 controller in background every 5 minutes?

There is a controller that parses data from a specific site and writes it to the mysql database. How to call it in the background every 5 minutes? Are there other options besides cron? OS Ubuntu 14.04 LTS.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergeyj, 2016-05-20
@sayber

I hope you have a console controller?
If yes, then set a task in cron and run yii xxx

T
titronfan, 2016-05-20
@titronfan

I don’t know if my advice will be in the topic, but in my opinion, apart from cron, it’s to register in html <META HTTP-EQUIV="REFRESH" CONTENT="300">and keep this tab in the browser constantly open :)

V
Valery, 2016-05-21
@supervaleha

If not cron, then you can execute the code and fall asleep for 5 minutes:
Although, in my opinion, the cost is everything that is not Cron for such tasks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question