0

I have a laravel application hosted on a ubuntu server.While i was setting up the scheduler i ran this command on the terminal:

php artisan schedule:run >> /dev/null 2>&1

Reading the documentation it says that i should have included the previous command in a cron file.I then created a cron configuration like so:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

When using ps aux to check it shows:

User1@Laravel-Project:~$ ps aux | grep "artisan schedule:run"
User1  143147  0.0  0.0   7008  2100 pts/4    S+   16:55   0:00 grep artisan schedule:run

Will this create a problem in the future and so how can i fix it

cdBreak
  • 63
  • 6
  • can u elaborate more what is your issue? i don't understand you. what do you want to achieve? what errors are you getting? – ericmp Dec 12 '22 at 16:38
  • In the documentation of laravel it said that i have to put that command in a cron file and i did like so: * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 but while i was tetsting it i ran it direclty in the terminal like this: php artisan schedule:run >> /dev/null 2>&1 – cdBreak Dec 12 '22 at 16:45
  • What im asking is if its possible that this will throw an error beacause when i run ps aux it shows the php artisan command still running – cdBreak Dec 12 '22 at 16:47
  • sorry if im not clear im new to ubuntu – cdBreak Dec 12 '22 at 16:47
  • no idea how to help, u should explain it better or i don't understand you, maybe someone else does. If you are running the project in your local env, you should [run the scheduler locally](https://laravel.com/docs/9.x/scheduling#running-the-scheduler-locally) – ericmp Dec 12 '22 at 16:49
  • If it shows as still running it means it's running i.e. not terminated with an error so either working on a long task or stuck in a loop. Usually cron logs more info in /var/syslog so might be wort checking in there (assuming syslog-ng is installed) – apokryfos Dec 12 '22 at 17:30

0 Answers0