R
R
Ruslan2017-07-10 19:07:45
Yii
Ruslan, 2017-07-10 19:07:45

How to run a console command correctly so that it runs from a certain time at a certain interval?

Good day. The site is developed on yii2 advance. In console/config, the file schedule.
I prescribe in it

$schedule->command('моя команда')->cron('*/10 7-18 * * *');

to automatically run the command every 10 minutes from 7:00 to 18:00. But when I store it, nothing works. Testing on OpenServer. The command itself works correctly - checked manually.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-10
@webinar

In console/config - schedule file

What's in this file? There is no such thing in yii2 out of the box, you have added something, you are doing something, so at least describe what exactly. What's in this file? Why from there at all? There are usually settings in the console / config folder, so what you put in the configuration file
$schedule->command('моя команда')->cron('*/10 7-18 * * *');

It's already weird. But what about the variable $schedule? Judging by the syntax, there is an object, but which one?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question