Skip to content

Cron Manager

Module: Magenx_CronManager · admin only, no storefront or GraphQL part

Cron Manager shows every cron job on the installation, Magento’s own and every other module’s, in one grid. From there you can switch jobs on and off, reschedule them, run them by hand, and see on a timeline what cron did and will do. It can also alert you when runs fail, are missed or get stuck.

The Cron Jobs grid listing every job with schedule, status and last run
System > Cron Manager > Cron Jobs.
FeatureWhere
Every job with its module, group, schedule, status, failed and missed runs in the last 24 hours, last run, duration and next run. Jobs whose last run failed or was missed show in red.System > Cron Manager > Cron Jobs
Reschedule a job with any cron expression. It is validated before saving.Cron Jobs > Edit
Enable or disable jobs, one at a time or in bulk.Cron Jobs
Move a job to another cron group, or point it at another class and method.Cron Jobs > Edit (separate permission)
Reset a job to exactly what its module declares.Cron Jobs
Cron status: when cron last ran (with a warning after 10 quiet minutes), and run counts by status.Top of Cron Jobs and Schedule Log
Every pending, running, finished, missed and failed run. Filter, export and delete.System > Cron Manager > Schedule Log
Run a job now, or queue it for cron’s next run.Schedule Log, Cron Jobs, job form
One lane per job, one bar per run, coloured by status, over 1 to 48 hours.System > Cron Manager > Timeline
Admin inbox message and/or email about failed, missed or stuck runs.Stores > Configuration > Magenx > Cron Manager
The cron timeline with one lane per job and coloured bars per run
System > Cron Manager > Timeline.

Your changes are kept by Cron Manager, apart from each module’s own files. When cron reads its job list, Cron Manager applies them on top. Nothing in any module is edited, no cache flush is needed, and Reset removes a change completely.

Job list declared
by every module

Effective job list

Your changes
(Cron Manager)

Magento cron
schedules and runs

  • A disabled job gets no new runs, and its pending runs are deleted. It stays in the grid, so you can still run it by hand.
  • A schedule you set wins over the module’s own schedule and its configuration setting.
  • A group can only be one that jobs already use.
  • A class and method change is checked on save, and again each time cron reads the list. If the class is later removed, the job falls back to its module’s own code.
  • Every change deletes the job’s pending runs. Cron creates new ones at its next schedule generation, every 15 minutes by default.

Run Now runs the job inside your admin request and records it in the log as run by you. It refuses to start while cron is running the same job. It is limited by the web server’s time limits, so use it for testing and short jobs.

Queue adds a pending run that cron picks up on its next pass, exactly as if cron had scheduled it. Use it for long jobs. A disabled job can’t be queued; enable it first or use Run Now.

  1. Go to Stores > Configuration > Magenx > Cron Manager > Failure Notifications.
  2. Turn on Enable Notifications and choose which outcomes to report in Notify About: Error, Missed, Stuck, or any mix.
  3. If you report stuck runs, set Stuck After (Minutes) (default 60, from 1 to 1440). A run still running this long is reported as stuck.
  4. Choose an admin inbox message, an email, or both. For email, enter the recipients.

Reporting starts when you switch it on, so you are not sent the whole failure history. Each run is reported once. One check looks back at most 6 hours and lists at most 200 runs.

A run is stuck when it stays running past Stuck After, usually because its process was killed (out of memory, a deploy, a server restart) and never recorded an end. Magento marks such a run as failed only a day later. Stuck runs are looked for up to 48 hours back. If a stuck run later fails, the failure is reported too.

If you saved Notify About before the Stuck option existed, your saved selection is kept. Select Stuck there to turn it on.

Find a task and its state

  1. An admin user opens the task view.
  2. Every declared task is listed with code, owning module, platform or extension, group, effective schedule, state, whether it is overridden, last run status, last run time and duration, and next planned run.
  3. The user filters by module and last status "error"; only matching tasks remain.
  4. Tasks whose last run failed or was missed stand out in bold, in the error colour.
  5. The user clicks the failed count in the health summary; the view lists only tasks with a failed run in the last 24 hours, and the filter shows as applied.

Disable a task

  1. The user disables a task from its row, or several tasks with a bulk action that warns that disabling platform tasks can break the store.
  2. The tasks show as disabled and overridden.
  3. Their pending runs are removed at once; the scheduler plans no new runs for them.

Reschedule a task

  1. The user opens the task form, which shows the declared schedule as the default.
  2. The user enters a new schedule and saves.
  3. An invalid schedule is refused with a message naming the faulty field; nothing is saved.
  4. A valid one is saved; the task's pending runs on the old schedule are removed and the scheduler plans new ones at its next planning pass.
  5. Entering the declared schedule, or leaving the field empty, removes the schedule override.

Change group or target

  1. A user with the advanced permission sees group and target fields on the form; others see them read-only.
  2. The group can only be one that already exists.
  3. A target that cannot be executed is refused on save.

Reset

  1. The user resets a task (or several in bulk).
  2. All its overrides are removed; it runs on its declared settings again.

Review runs and run again

  1. The user opens the run log, newest first, and filters by task, status and date.
  2. From a failed run, the user chooses "Run now". The task runs inside the request; a new run entry records the outcome and who started it; the page reports success with duration, or the failure message.
  3. Alternatively the user chooses "Queue"; a pending run for the current minute is added and the scheduler executes it on its next pass.
  4. The user selects old entries and deletes them.

Timeline

  1. The user opens the timeline: a 6-hour window by default, three quarters past and one quarter ahead of now.
  2. Each task with runs in the window has one lane; each run is a bar coloured by status, spanning start to finish, with details on hover; a marker shows now.
  3. The user switches the window between 1 and 48 hours, steps earlier or later, and filters by task code.

Notification

  1. An admin switches notifications on and chooses statuses, inbox and email recipients.
  2. The first check only records the start time; earlier failures are not reported.
  3. A later check finds two failed runs and sends one digest to the inbox and the recipients.
  4. The next check finds no new failed runs and sends nothing.
  5. A run has been running for longer than the stuck threshold. The next check reports it once as stuck. If it later ends in error, that error is reported too.

These always hold:

  • Nothing stored by this feature can make the scheduler fail for tasks it does not concern.
  • A task with no override runs exactly on its declared settings.
  • A disabled task is never run by the scheduler after the disable is saved.
  • Module definitions and store configuration of tasks are never modified; removing an override fully restores the declared behaviour.
  • Two executions of the same task never run at once because of a manual run, and a manual run never marks a live scheduler run as failed.
  • Each failed or missed run is notified at most once, and none from before notifications were last switched on. Each stuck run is notified as stuck at most once; being reported as stuck does not stop a later error of the same run being reported.
  • A valid schedule has 5 fields (a 6th is accepted and ignored, as the scheduler does). Each field is a comma list of *, a value, or a range a-b, each optionally with a step /n where n ≥ 1. Ranges: minute 0–59, hour 0–23, day of month 1–31, month 1–12 or month names, day of week 0–6 or day names; names match on their first three letters, any case. A range runs low to high.
  • Declared schedule = the store-configuration value the module points at, if set; otherwise the module's own schedule.
  • Effective schedule = the override if set, otherwise the declared schedule. A disabled task has no effective schedule.
  • Effective group = the override if that group exists, otherwise the declared group.
  • Effective target = the override if it is executable now, otherwise the declared target. Executable = an existing, concrete unit of code with a public, instance-level operation of that name.
  • Last run = the newest run that is not pending. Next run = the earliest pending run. Duration = finished minus started.
  • Owning module and platform/extension are derived from the target, with no extra lookup per task.
  • A check reports failed and missed runs planned at or after the later of "notifications switched on" and "now minus 6 hours". It reports stuck runs planned at or after the later of "notifications switched on" and "now minus 48 hours" that started more than the stuck threshold ago and have not ended.
  • A task's failed (missed) count = its runs with status error (missed) planned in the last 24 hours. Summed over all tasks, it equals the failed (missed) count above the task view. It is independent of the last run status: a task that failed and then succeeded has a non-zero failed count and is not highlighted.
  • "Is the scheduler running, and what failed today?" is answerable from one screen.
  • Every manual run is attributed to the user who started it.
  • "Overridden" in the task view always means at least one effective setting differs from the declared one, or the task is disabled.
SituationWhat happens
Overrides cannot be read (storage missing or unavailable).Scheduler runs every task on declared settings; one error logged per process.
Target override names code removed in a later deployment.Task runs its declared target.
Group override names a group that no longer exists.Task stays in its declared group.
Override exists for a task no module declares any more.Ignored; no error.
Schedule 0 25 * * , /0 * * * , 0 0 * 7 or 0 10-5 * * * entered.Refused, message names the field; nothing saved.
Declared schedule entered as an override.No schedule override stored.
Task disabled while it has pending runs in the next 20 minutes.Pending runs removed at once; none execute.
Run now while the scheduler is running the same task.Refused with a message; the live run is untouched.
Task fails during run now.Run entry with status error and the failure message; the admin page still loads and shows it.
Queue on a disabled task.Refused with an explanation.
"Select all" bulk disable with a filter applied.Only the filtered tasks change.
Bulk delete of 20,000 log entries.Deleted in bounded batches.
Notifications switched on with 3 days of failed runs in the log.None of them reported; only later ones.
Notifications switched off and on again.Reporting restarts from the new switch-on time.
Mail delivery fails during a check.Inbox message still created; failure logged; runs marked reported, not re-sent every check.
500 failed runs found in one check.200 reported; the rest in following checks; none twice.
Task message contains markup or script.Shown as text in every screen and in the email.
Run still running at the end of the window.Bar extends to now, clipped to the window.
Run planned exactly at the window's right edge.Bar stays fully inside the window.
No run has ever happened.Health summary says so and warns.
A task missed 4 times in the last 24 hours, then succeeded.Missed count 4 above the task view; clicking it lists the task with missed count 4; its last run status is success and the row is not highlighted.
A task whose only failed run is 2 days old.Failed count 0; not listed by the failed link; the run log's failed count includes it.
Stuck threshold 60; a run started 61 minutes ago is still running, another started 30 minutes ago.Only the first is reported as stuck.
A run reported as stuck later ends in error within the 6-hour look-back.The error is reported once; the stuck report is not repeated.
  • Every task declared on the installation, by the platform or any module.
  • Global scope only.
  • Creating new tasks from the admin panel; only declared tasks are managed.
  • Installing, starting or monitoring the operating-system scheduler that triggers the platform's scheduler.
  • Changing task-group settings (how far ahead runs are planned, how long they wait, how long history is kept).
  • Running a task on a different server or in a separate process from the admin panel.
  • Alerting on slow runs, runs that never finish, or the scheduler being down.
  • Per-store settings: the scheduler runs once per installation.
  • Any storefront feature or storefront API.
Terminal window
composer require magenxcommerce/module-cron-manager
bin/magento module:enable Magenx_CronManager
bin/magento setup:upgrade
bin/magento setup:di:compile # production mode only
bin/magento cache:flush
  • PHP ~8.4.0||~8.5.0, Magento 2.4.8.

Default scope only.

Stores > Configuration > Magenx > Cron Manager

Failure Notifications

SettingDefaultScopeNotes
Enable Notifications
magenx_cron_manager/notifications/enabled
NoGlobalYes/No. Reports cron runs that ended in one of the statuses below. Each run is reported once; runs that failed before this was switched on are not reported.
Notify About
magenx_cron_manager/notifications/statuses
error,missed,stuckGlobalMultiple select. Shown when Enable Notifications = Yes. Error: the job threw. Missed: cron did not start the job before its schedule lifetime ran out, usually because cron was down or overloaded. Stuck: the run is still "running" after the time set below, usually because its process was killed.
Stuck After (Minutes)
magenx_cron_manager/notifications/stuck_after
60GlobalText. Shown when Enable Notifications = Yes. A run still running this long is reported as stuck, once. Used only when Stuck is selected above. Set it above the longest normal run of your slowest job (full reindexes, sitemap, imports).
Add to Admin Notifications
magenx_cron_manager/notifications/admin_inbox
YesGlobalYes/No. Shown when Enable Notifications = Yes. One message per check in System > Notifications, summarising every failure found by that check.
Send Email To
magenx_cron_manager/notifications/email_recipients
emptyGlobalText. Shown when Enable Notifications = Yes. Comma-separated addresses. Leave empty to send no email.
Email Sender
magenx_cron_manager/notifications/email_identity
General ContactGlobalDropdown. Shown when Enable Notifications = Yes.
Email Template
magenx_cron_manager/notifications/email_template
Module's default templateGlobalDropdown. Shown when Enable Notifications = Yes.
Check Schedule
magenx_cron_manager/notifications/schedule
*/15 * * * *GlobalText. Shown when Enable Notifications = Yes. Cron expression for the check, e.g. */15 * * * * for every 15 minutes.
  • System > Cron Manager > Cron Jobs
  • System > Cron Manager > Schedule Log
  • System > Cron Manager > Timeline

Grant these under System > Permissions > User Roles > Role Resources:

ResourceUnderID
Cron ManagerSystemMagenx_CronManager::cron
View Cron JobsSystem > Cron ManagerMagenx_CronManager::jobs
Enable, Disable and Reschedule JobsSystem > Cron Manager > View Cron JobsMagenx_CronManager::jobs_edit
Change Job Group, Class and MethodSystem > Cron Manager > View Cron JobsMagenx_CronManager::jobs_advanced
View Schedule LogSystem > Cron ManagerMagenx_CronManager::schedule
Run and Queue JobsSystem > Cron Manager > View Schedule LogMagenx_CronManager::schedule_run
Delete Schedule Log EntriesSystem > Cron Manager > View Schedule LogMagenx_CronManager::schedule_delete
View Cron TimelineSystem > Cron ManagerMagenx_CronManager::timeline
Cron Manager SettingsStores > Settings > ConfigurationMagenx_CronManager::config
JobGroupDefault scheduleChange it at
magenx_cron_manager_notifydefault*/15 * * * *magenx_cron_manager/notifications/schedule
  • Times show in the admin timezone (General > Locale Options > Timezone). Magento evaluates cron expressions in the same timezone.
TermMeaning
TaskA scheduled background job declared by a module, identified by a unique task code.
SchedulerThe platform component that plans runs of every enabled task and executes them; triggered every minute by the operating system.
ScheduleA standard five-field cron expression (minute, hour, day of month, month, day of week), evaluated in the store's admin timezone.
GroupA named set of tasks the scheduler plans and runs together, with its own timing settings.
TargetWhat a task executes: a callable unit of code and the operation on it.
Declared settingsA task's schedule, group and target as its module defines them, including a schedule its module reads from store configuration.
OverrideA change made in this feature to a task's state, schedule, group or target. A task with no override runs on its declared settings.
Effective settingsDeclared settings with the override applied — what the scheduler actually uses.
RunOne planned or actual execution of a task, kept in the run log.
Run statuspending (planned), running, success, error (the task failed), missed (not started before its group's waiting time ran out).
Run logThe list of runs the scheduler keeps, and that it prunes on its own history settings.
Run nowExecute a task immediately, inside the admin request.
QueueAdd a pending run for the current minute, for the scheduler to execute on its next pass.
Scheduler activityThe latest time any run started or finished.
Stuck runA run still in status running longer than the stuck threshold, usually because its process was killed and never recorded an end. Not a run status of its own.
Stuck thresholdHow many minutes a run may stay running before it is reported as stuck.
CheckOne pass of the notification job looking for failed, missed and stuck runs.