0

I am running a Laravel app on Elastic Beanstalk Linux AMI 2.

I am using the following config file in the .ebextensions folder to set up the cron.

files: "/etc/cron.d/schedule_run": mode: "000644" owner: root group: root content: | * * * * * root . /opt/elasticbeanstalk/deployment/env && /usr/bin/php /var/www/html/php artisan schedule:run 1>> /var/laralog.log 2>&1 commands: remove_old_cron: command: "rm -f /etc/cron.d/*.bak" 

After deploying, it does not seem at all like the scheduling engine is running on the test instance. I set up a cron to write to my DB every 2 minutes and nothing is happening. Has something changed and now this code will no longer start the Laravel scheduler?

9
  • Have you try to write the command in script and run the script. Sometime cron do not "like:/"handle" well && in command Commented Jun 12, 2023 at 17:20
  • no, I am not sure how to do that. Commented Jun 12, 2023 at 17:27
  • Put this: . /opt/elasticbeanstalk/deployment/env && /usr/bin/php /var/www/html/php artisan schedule:run 1>> /var/laralog.log 2>&1 in file (in root home directory, Exec chmod 700 <fillename> and make record with time to be: * * * * * root /path/to/your/script Commented Jun 12, 2023 at 18:23
  • but wouldnt that start the scheduler over and over again? Commented Jun 12, 2023 at 19:11
  • I do not get it. What I propose do not change the logic. Commented Jun 12, 2023 at 19:13

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.