skip to Main Content

I’m using cPanel to create a cron like so :

* * * * * /home/elsdqscy/folder/update_db.sh > update_db.txt

Inside my shell file I have :

#!/bin/bash

cd folder && php artisan migrate:fresh --seed --force

This should work, knowing that the command /home/elsdqscy/folder/update_db.sh works in the terminal.

I do get this error in the output file:

In ArgvInput.php line 246:
                                           
  Invalid argument supplied for foreach()  

Content-type: text/html; charset=UTF-8

Any idea what am I doing wrong?

3

Answers


  1. You need to provide the full path inside your shell file as well, like so:

    cd folder && /usr/bin/php artisan migrate:fresh --seed --force
    
    Login or Signup to reply.
  2. Did you try

    * * * * * cd /home/elsdqscy/folder/update_db.sh > update_db.txt
    
    Login or Signup to reply.
  3. Running The Scheduler
    laravel doc

    * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search