Cron Jobs configuration help

Hello ! I’m on a shared hosting, and I’m not sure, after reading the documentation on the installation of Invoice Ninja, if I need two Cron command or just one modified… ?

Right now, I have two in my Cron Jobs :

cd /home/user_name/www && /opt/alt/php81/usr/bin/php artisan schedule:run > /dev/null 2>&1 * * * * *

cd /home/user_name/www && /opt/alt/php81/usr/bin/php -d register_argc_argv=On artisan queue:work --stop-when-empty > /dev/null 2>&1. */5 * * * *

Is this ok ?

I’ve also added the command to get the log to my mail " | mail -s “cron output” "

and I’m getting this message in my email on both Cron Jobs :

/bin/sh: mail: command not found

This is an error ?

Thank youuuu


If the crons aren’t running you’ll see an error in the app. The second cron is needed if you enables the queues.

I don’t recognize the mail command, is it from the docs?

I don’t see an error in the app, I’m having some issues with mail sending, but it seems ok for now, I was wondering if it have any connection.

I don’t have the Supervisor for the queue set up. Does that mean that I don’t need the second Cron Job ?

Does it also mean that I should have QUEUE_CONNECTION on sync instead of Database ?

I took the mail command from here : linux - How can I view results of my cron jobs? - Super User

You can either use Supervisor or the queue:work cron. If you set QUEUE_CONNECTION to sync it will disable the queue and run command synchronously instead. This will make some actions such as emailing slower in the app.

Ok, so it’s should be perfect like it is. Thanks.