Skip to content

Laravel scheduler monitoring: when schedule:run stops

Published December 1, 2026 · Updated December 3, 2026

Laravel scheduled tasks stop running for reasons that never throw an exception: the cron line that calls schedule:run is missing or points to the wrong directory, a lock left by a crash makes a task skip, the application stayed in maintenance mode. To monitor the scheduler, check the cron entry once, then have each important task report success to a heartbeat that alerts when the reports stop.

How the scheduler actually runs

Your schedule lives in routes/console.php (or in withSchedule() in bootstrap/app.php). Nothing in it runs by itself. The server needs exactly one cron entry, which calls schedule:run every minute; that command evaluates every task and starts the ones that are due:

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

Locally, run the scheduler in the foreground instead of installing a cron entry:

php artisan schedule:work

To see what is scheduled and when each task will next run:

php artisan schedule:list

This design is convenient, but it has a consequence worth stating plainly: every scheduled task depends on one line in a crontab that is not in your repository. If that line disappears, every task stops at once, and Laravel cannot tell you, because Laravel is not running.

Why scheduled tasks stop silently

The cron line is missing

The classic case after a server migration, a rebuild from a fresh image, or a move to a new hosting panel. The application answers requests normally, so nothing looks wrong. Check with crontab -l as the user that should run it (often not root).

The cron line points to the wrong place

With zero-downtime deployments (Envoyer, Forge's zero-downtime mode, Deployer), each release lives in its own directory and a current symlink points to the active one. The cron line must go through the symlink:

* * * * * cd /home/forge/example.com/current && php artisan schedule:run >> /dev/null 2>&1

If it points to a specific release directory, it keeps running the old code until that directory is pruned, then fails every minute. If it points to the site root where no artisan file exists, it fails from day one. In both cases the output goes to /dev/null, so the error is thrown away.

The wrong PHP binary

Cron runs with a minimal PATH. On a server with several PHP versions, php in cron may not be the version your application needs, or may be missing the extensions it uses. Use the absolute path of the binary you deploy with, for example /usr/bin/php8.4.

A lock that never expires

withoutOverlapping() stops a task from starting while its previous run is still going. It uses a cache lock that expires after 24 hours by default. If the server crashes in the middle of the task, the lock stays, and the task is skipped until it expires. Shorten the expiry for frequent tasks, and clear stuck locks after an incident:

Schedule::command('emails:send')->everyFiveMinutes()->withoutOverlapping(10);
php artisan schedule:clear-cache

Maintenance mode

Scheduled tasks do not run while the application is in maintenance mode. A deploy that fails between php artisan down and php artisan up stops every task, including the nightly backup, until someone notices the site. Tasks that must run regardless can opt in with evenInMaintenanceMode().

A task that fails every night

A task that throws is a different case: the scheduler runs it, the command exits with an error, and if an error tracker is installed, it receives the exception. But a task can also fail without throwing: it catches its own exception and logs it, processes zero rows because an API changed, or returns a non-zero exit code that nothing listens to. Nothing escalates.

Time zones and several servers

With a per-task timezone(), daylight saving time changes can make a task run twice or not at all on those nights; the documentation recommends avoiding scheduled time zones when possible. With several servers running the same cron, onOneServer() makes only one of them run a task, but it requires a shared database, memcached, dynamodb or redis cache. With a file cache on each machine, every server takes its own lock, so the guarantee is gone.

What Laravel gives you

Hooks

Each task accepts hooks. onSuccess() and onFailure() distinguish a zero exit code from a non-zero one, and can receive the command output:

use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schedule;
use Illuminate\Support\Stringable;

Schedule::command('reports:send')
    ->dailyAt('06:00')
    ->onFailure(function (Stringable $output) {
        Log::error('reports:send failed', ['output' => (string) $output]);
    });

before() and after() run around the task whatever the outcome. Laravel also dispatches events you can listen to: ScheduledTaskStarting, ScheduledTaskFinished, ScheduledTaskSkipped and ScheduledTaskFailed, in Illuminate\Console\Events.

Output by email

Schedule::command('report:generate')
    ->daily()
    ->emailOutputOnFailure('ops@example.com');

This requires a working mail configuration, and like sendOutputTo() and appendOutputTo() it only works for tasks defined with command() or exec(), not closures.

Pinging a URL

The scheduler can call a URL around a task, which is how external cron monitoring services are wired:

Schedule::command('backup:run')
    ->daily()
    ->pingBefore($startUrl)
    ->pingOnSuccess($successUrl)
    ->pingOnFailure($failureUrl);

thenPing() pings after the task whatever its result, and the ...If variants (pingBeforeIf, thenPingIf, pingOnSuccessIf, pingOnFailureIf) add a condition.

Running long tasks in parallel

Tasks due at the same minute run one after the other in the order they are defined. A slow task delays the ones after it. runInBackground() (for command() and exec() tasks only) starts them side by side.

The limit of every hook: they need the scheduler to run

onFailure(), emailOutputOnFailure(), pingOnFailure() and the scheduler events are all executed by schedule:run. If the cron line is gone, the path is wrong or the application is in maintenance mode, none of them fire. They report on tasks that run and fail, never on tasks that do not run.

The answer is a dead man's switch, also called a heartbeat:

  1. The task signals success each time it completes (a ping).
  2. A service outside your server knows how often to expect that signal.
  3. When the signal is late beyond a grace period, the service alerts you.

Silence becomes the alert. This covers every case above at once, including the ones you have not thought of, because it watches the result rather than the cause. Two details matter:

  • Ping on success, not before the task. A ping before the task proves the scheduler started, not that the backup finished.
  • Choose the grace from the task's real duration. A backup that takes between 5 and 40 minutes needs a grace of about an hour; a false alert at 3 a.m. teaches people to ignore the channel.

It is also worth one heartbeat on the scheduler itself, pinged every time schedule:run starts, so that a missing cron line raises one clear alert instead of a dozen late tasks.

Queue workers have the same blind spot and the same remedy; see the queue monitoring guide. For tasks that do throw, the 500 error guide and Laravel logging in production cover where exceptions and logs should go.

Official reference: Task Scheduling.

With Quiet Guard

Quiet Guard receives heartbeats and alerts when one is late. Since version 0.4 of the SDK, it pings a scheduler heartbeat every time schedule:run starts in production, with the period it observes from your cron, so a missing or broken cron line is detected without configuration. For individual tasks, chain the macro, which pings only when the task succeeds:

Schedule::command('backup:run')->daily()->monitorHeartbeat('nightly-backup');

Outside Laravel's scheduler, ping with php artisan monitor:heartbeat nightly-backup or POST /api/v1/heartbeats/{slug}. A heartbeat wired with the macro, the monitor:heartbeat command or the API is created unarmed on its first ping, and never alerts until you set its period and grace on the project's Heartbeats tab. Only the automatic scheduler and queue heartbeats arm themselves. Once armed, a heartbeat alerts once per outage, in the dashboard bell of every member and on every channel you add on the project's Alerts tab: email on every plan, Slack, Discord, Teams or webhook on Solo, Indie and Studio. Heartbeats are included on every plan.

composer require quiet-guard/laravel-monitor
MONITOR_KEY=your-project-api-key

Details: heartbeats in the SDK, how arming works, cron job monitoring.

The UptimeRobot and Better Stack comparison pages put heartbeats side by side, with their sources.

In Quiet Guard

Cron job monitoring

A task that fails raises an error. A task that stops running raises nothing. Quiet Guard tells you when one stops checking in.

Alerts and notifications

An alert when an issue appears or comes back, when the site goes down, when a task stops pinging or a certificate nears expiry. By email, Slack, Discord, Teams or webhook, and in the dashboard.

Uptime and status page

Without a probe, your client is the one who tells you the site is down. Ours runs every five minutes, and tries an error page or a refused connection again before it calls an outage.