Answer the question
In order to leave comments, you need to log in
Why is the command not executing in laravel 5.2 cron?
Hello everyone, straight to the point
config/queue config:
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
//'table' => 'jobs',
'table' => 'ncste_jobs',
'queue' => 'default',
'expire' => 60,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'ttr' => 60,
],
'sqs' => [
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
'queue' => 'your-queue-name',
'region' => 'us-east-1',
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'expire' => 60,
],
],
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'ncste_failed_jobs',
],
protected function schedule(Schedule $schedule)
{
//here som comand
$schedule->command('sudo supervisorctl stop laravel-worker:*')->name('supervisorctl-stop')->everyMinute()->withoutOverlapping();
$schedule->command('sudo supervisorctl start laravel-worker:*')->name('supervisorctl-start')->everyMinute()->withoutOverlapping();
//here some command
}
* * * * * /usr/bin/php /var/www/mydomain.com/artisan schedule:run 1>>/dev/null 2>&1
Answer the question
In order to leave comments, you need to log in
$schedule->exec('sudo supervisorctl stop laravel-worker:*')->everyMinute()->withoutOverlapping();
$schedule->exec('sudo supervisorctl start laravel-worker:*')->everyMinute()->withoutOverlapping();
Maybe you don't have permissions? Have you tried looking at /var/log/cron logs?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question