This is not a cronjob: /usr/local/bin/php /home/username/public_html/sitename/projectPath && php artisan schedule:run >> /dev/null 2>&1
Checkout this page: https://help.fasthosts.co.uk/app/answers/detail/a_id/2198/~/setting-up-cron-jobs-in-cpanel
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I have created one command which will add some record to mysql database.
When I execute command with terminal, command is adding data to database.
Then I have modified Kernel.php
protected $commands = [
\App\Console\Commands\AddData::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command('word:add')->everyMinute();
}
I have setup cron job in CPanel.
Command Setting : Once per minute.
Command added as : /usr/local/bin/php /home/username/public_html/sitename/projectPath && php artisan schedule:run >> /dev/null 2>&1
But it is not adding row to database table. am I missing anything or I am doing something wrong with it?
I have figure out the problem. for this case, we need to give path of artisan file, so the command would be
* * * * * /usr/local/bin/php /home/username/public_html/sitename/projectPath/artisan schedule:run >> /dev/null 2>&1
Please or to participate in this conversation.