D
D
Dmitry2018-10-15 10:55:58
Laravel
Dmitry, 2018-10-15 10:55:58

How to run a cron job in Laravel?

Hello!
There is a command
$schedule->command('service:priceup')->cron('45 10 * * *');
In theory, it should start at 10:45, but for some reason it doesn’t work, what could be the reason? Call from the console, the command works correctly.

The problem was in calling additional methods in the routing, namely for dev Artisan::call('view:clear');
Removed everything worked.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2018-10-15
@alexey-m-ukolov

Did you do everything according to the instructions ?
When using the scheduler, you only need to add the following Cron entry to your server:
This Cron will call the Laravel command scheduler every minute. When the schedule:run command is executed, Laravel will evaluate your scheduled tasks and runs the tasks that are due.

K
Kairat Ubukulov, 2018-10-15
@ubukulov

$schedule->command('stocks:cron')->cron("*/15 * * * *"); every 15 minutes
According to the schedule, you can see here
https://en.wikipedia.org/wiki/Cron

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question