2

I would like to know how create a cron with AWS elastic beanstalk and laravel task scheduling.

Currently AWS elastic beanstalk propose to create a cron.yaml file but this file take in paramters only the url. However laravel need to execute a command. I don't know how to do it.

Can you help me please ?

Derlin
  • 9,572
  • 2
  • 32
  • 53

2 Answers2

0

Having done lots of googling, I don't think AWS EB supports executing the schedule:run command directly from app. Instead, the command will have to be triggered from an endpoint just as explained in the docs here.

I found a package here which helped me setup the endpoint easily

Hope it helps...

Steve Junior
  • 166
  • 2
  • 5
  • 1
    Hi, thanks for your good response, can you explain me how create a worker environment. This environment sould be same to my web environment or it's a different application ? – Mathieu Paczesny May 26 '17 at 09:34
0

Getting Laravel Scheduled tasks working is a lot simpler if you just do this:

sudo vi /etc/crontab

and add the line to the bottom of the file:

* * * * * webapp cd /var/www/html/<yourAppFolder>/ && php artisan schedule:run >> /dev/null 2>&1

Done!

NULL pointer
  • 1,116
  • 1
  • 14
  • 27