Структура файла
Код: Выделить всё
[Project root]
|-- .ebextensions
| |-- cronjob.config
Код: Выделить всё
files:
"/etc/cron.d/schedule_run":
mode: "000644"
owner: root
group: root
content: |
* * * * * root . /opt/elasticbeanstalk/support/envvars && /usr/bin/php /var/www/html/artisan schedule:run 1>> /dev/null 2>&1
commands:
remove_old_cron:
command: "rm -f /etc/cron.d/*.bak"
Код: Выделить всё
protected function schedule(Schedule $schedule)
{
$schedule->command(DeleteRecord::class)->everyMinute()->onOneServer();
}
- PHP 8.0
- Ларавел 9
Подробнее здесь: https://stackoverflow.com/questions/784 ... c-binstack