Skip to content
Magento glossary

What is Magento Cron?

Short answer Magento cron runs scheduled application jobs. An external scheduler invokes bin/magento cron:run, modules define jobs and groups in crontab.xml, and cron_schedule records individual runs. Queue consumers have a separate processing lifecycle, although cron can start them.

This entry explains the scheduler, job definitions and run history. Use the linked troubleshooting guide when you need a step-by-step investigation of jobs that are not completing.

How it works
  1. A scheduler calls the Magento runner 01
  2. Modules describe the work and its schedule 02
  3. Scheduled runs are recorded before execution 03
  4. The journal explains what happened 04
  5. Queue consumers have their own lifecycle 05
Each step is explained below
  • Entry point bin/magento cron:run
  • Job definitions Module crontab.xml files
  • Run history cron_schedule and cron.log

Watch for this A scheduler entry is treated as a successful run

How it works

How a scheduled Magento job reaches completion

Follow a scheduled task from the external trigger to its recorded outcome, then distinguish it from a queue consumer.

  1. A scheduler calls the Magento runner

    The operating system or hosting platform starts bin/magento cron:run. Adobe's standard crontab example calls it each minute, but that does not make every Magento job a one-minute task. Each job has its own schedule. Check the existing scheduler before adding another entry, especially when more than one web node serves the store.

  2. Modules describe the work and its schedule

    An enabled module declares a job name, handler and schedule in etc/crontab.xml. Jobs belong to groups so their scheduling settings can be managed together. Names such as default, index and consumers describe common groups; extensions can add others.

  3. Scheduled runs are recorded before execution

    Magento creates entries in cron_schedule and processes work when it becomes due. The first manual invocation can create future schedule rows rather than execute a newly discovered job immediately. A later invocation must reach the scheduled time. This distinction matters when a new job appears to do nothing.

  4. The journal explains what happened

    A run can remain pending, start running, finish successfully, fail or miss its permitted start window. Read the row's scheduled, execution and finish times alongside the logs. A missed status tells you the start window was exceeded; it does not identify the cause by itself.

  5. Queue consumers have their own lifecycle

    The consumers_runner cron job can start message-queue consumers. A separate process manager can also supervise them. These workers process queued messages rather than replace the scheduler. Document which mechanism owns the workers so changes to cron do not accidentally stop asynchronous processing.

When to use

How the scheduler fits different environments

The application jobs are the same concepts, but the mechanism that starts them depends on the environment.

  • An operating storefront

    Scheduled indexing, price rules, configured notifications and other background work depend on a functioning runner. A storefront that still loads is not proof that these tasks completed. Check recent successful runs and investigate the age of pending work, rather than relying on a scheduler entry alone.

  • Development and staging

    Decide which jobs a test environment should run. Email, imports and external integrations can have real effects even on a development machine. Use the project's own scheduler and PHP setup, keep production integrations isolated, and run a job deliberately when testing its behavior.

  • Adobe Commerce on cloud infrastructure

    Cloud projects declare scheduled commands through the crons property in .magento.app.yaml. Consumer settings have their own Cloud configuration. Review the project's actual application configuration and platform guidance instead of installing a second host crontab over it.

Common mistakes

Four scheduling assumptions to check

These checks help avoid confusing a configured scheduler with completed application work.

  • A scheduler entry is treated as a successful run

    An entry can exist while its PHP executable, working directory, permissions or database connection is wrong. Compare the command that is actually scheduled with recent cron_schedule rows and log entries. After a migration, verify that work executes on the intended node.

  • A slow job is answered with more overlapping runs

    Increasing the launch frequency does not repair a handler that takes too long or waits on another service. Check execution duration, locks and resource usage first. Review group settings and worker ownership before adding processes; there is no universal interval or worker count for every store.

  • History is removed before the failure is understood

    The schedule table is evidence as well as a queue of work. Do not empty it to make an alert disappear. Inspect failed and missed jobs, then review the configured history retention and cleanup behavior. Any separate cleanup should have an owner, a backup and a narrowly reviewed scope.

  • Commands run under an assumed server account

    Use the designated Commerce file-system owner for Magento CLI commands. It may share access with a different web-server account through the deployment's permission model. Do not assume the account is www-data, and do not use root to work around ownership errors.

FAQ

Questions about Magento scheduled jobs

My cron isn’t running, what’s the first thing to check?

Start with crontab -l under the Commerce file-system owner, or inspect the hosting platform's scheduler configuration. Look for the correct project path and PHP executable. Then compare recent schedule rows with var/log/cron.log and any redirected runner output. Do not add duplicate entries just because an older guide expects three lines. The cron troubleshooting article covers the diagnostic sequence.

My cron_schedule table grew to millions of rows, how do I fix it?

First identify which job codes and statuses account for the growth, and whether the normal history cleanup is running. Review the configured success and failure retention for the relevant group. Avoid emptying the table or deleting pending and running jobs as a generic remedy. A separate cleanup needs a reviewed retention rule and recovery plan; it should not erase the evidence of the original failure.

Should the cron user be different from the web user?

Magento CLI commands should run as the Commerce file-system owner. The web-server account can be different when the deployment provides appropriate shared permissions. What matters is the documented ownership model and writable paths, not a universal account name. Running cron as root can hide a permission problem while creating files that the application cannot subsequently manage.

Magento cron vs system cron, what’s the difference?

System cron is an operating-system scheduler. Magento cron is the application's job configuration and runner that an external scheduler invokes. On a typical self-hosted installation the host calls bin/magento cron:run; on a managed platform the scheduling mechanism can be provided by the host. Magento then decides which application jobs are due.

Adobe Commerce Cloud cron, is it auto-managed or do I configure it?

Cloud uses the application's crons configuration and platform-specific settings for consumers. The project still needs correct job definitions, monitoring and suitable schedules. Review the actual environment configuration and Adobe's Cloud cron documentation; do not assume that every platform, plan or custom worker has the same arrangement.

Can you show a custom cron task example?

A small custom task needs a job definition in etc/crontab.xml and a PHP handler. For example, a module can declare a default-group job with <schedule>0 3 * * *</schedule> and an execute method. The handler should perform a bounded, repeat-safe task and log failures. Scheduling it is not evidence that it has executed; check a completed run in a test environment.

Performance audit

Need help investigating scheduled work?

Describe the affected jobs and environment when discussing an investigation. The performance service explains the wider scope; availability and deliverables depend on the work agreed.

Kishan Savaliya Online 10 AM to 7 PM IST Chat on WhatsApp