![](/img/trans.png)
[英]ASP.NET Core Application not Running in AWS Linux EC2 instance instead showing Apache Test Page
[英]Laravel 8 schedule via cron on AWS EC2 linux - commands not running
我在 AWS EC2 中创建了一个 cron 作业,但它没有在预定时间运行。当我在 cli php artisan schedule:run 中运行命令时,它工作正常但没有在预定时间自动执行。
php 版本=7.4.3
php 框架 = 8
我使用 crontab -e 在 crontab 中添加了 cron 条目
* * * * * cd /var/www/html/artisan schedule:run >> /dev/null 2>&1
/var/www/html/app/Console\Kernal
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('booking:cron')->everyMinute();
}
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands=[
'\App\Console\Commands\BookingCron',
];
你的 cron 命令中有一个不需要的cd
,它应该是
* * * * * /var/www/html/artisan schedule:run >> /dev/null 2>&1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.