Laravel Scheduler Not Running - How to Fix
This issue occurs when Laravel's scheduled tasks don't execute, usually due to missing cron job configuration.
The Error
Scheduled commands not running
Common Causes
- 1 Cron job not configured on server
- 2 Wrong cron syntax or path
- 3 Cron user permission issues
- 4 Schedule not defined in Console Kernel
- 5 Task throwing exceptions silently
Solutions
Add Laravel scheduler to crontab
# Edit crontab
crontab -e
# Add this line (adjust path to your project)
* * * * * cd /var/www/your-project && php artisan schedule:run >> /dev/null 2>&1
Define schedule in Console Kernel
// app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->hourly();
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('telescope:prune')->daily();
// Custom closure
$schedule->call(function () {
// Your code
})->everyMinute();
}
Test scheduler locally
# Run scheduler once (for testing)
php artisan schedule:run
# List all scheduled tasks
php artisan schedule:list
# Run scheduler continuously (local dev)
php artisan schedule:work
Debug scheduled tasks
// Add output and error logging
$schedule->command('your:command')
->daily()
->appendOutputTo(storage_path('logs/scheduler.log'))
->emailOutputOnFailure('admin@example.com');
Need Help With Your Laravel Project?
I specialize in building custom Laravel applications, process automation, and SaaS development. Whether you need to eliminate repetitive tasks or build something from scratch, let's discuss your project.
Currently available for 2-3 new projects
About Hafiz
Senior Full-Stack Developer with 9+ years building web apps and SaaS platforms. I build web applications with Laravel and Vue.js, and automate business processes. Creator of ReplyGenius, StudyLab, and other SaaS products.
View Portfolio