Script linux Artisan Laravel

0

I hired a shared server, which runs scheduled tasks ( CRON TABLE ) via linux scripts (.sh). How do I run a php artisan ( php artisan enviar:emaildiario ) command inside this linux script?

Server UOL:

Script:

    
asked by anonymous 29.11.2018 / 23:09

1 answer

0

There are several ways you can do this, but I'll explain the two simplest ones:

Alternative 1:

Create a php page on your server, example link put the commands you want to run within that php script. Create a task in your crontab to char this url at the time you set.

* */1 * * * root wget -q --spider http://<seudominio|localhost>/crontab.php >/dev/null 2>&1

Alternative 2:

Create a crontab task with the following syntax:

* */1 * * * root /usr/sbin/php /caminho/completo/do/script.php

See more at link

  

Note:

     

For security reasons, change the user who will run the script.

     

Make sure that the user who will run the script has the   due execution permissions.

     

Be happy !!!

    
03.12.2018 / 14:35