Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Simple Cron

Security covered Under active development 3,721 sites

Simple Cron is a lightweight module that simplifies the creation and management of cron jobs. It provides a plugin system that allows for easy implementation of new cron tasks, offering configurations for enabling/disabling, scheduling, and displaying status messages for each job.

Simple Cron gives site builders and developers clear, per-job control over Drupal cron tasks. Each job can have its own schedule, status, execution rules, order, and optional settings.

The module automatically discovers Simple Cron plugins and can expose existing hook_cron() implementations and cron-enabled queue workers as independently configurable jobs. Use it when you need per-job scheduling, a lightweight API for implementing custom cron jobs with their own configuration, or both—without adopting a full cron orchestration system.

Features

Visual scheduling and clear previews

  • Build common schedules without writing cron syntax, or use an advanced cron expression when a preset does not fit.
  • Add multiple schedules to one job. The job runs whenever any expression matches (OR logic).
  • See plain-language descriptions and the next five combined run times in the site's configured timezone while keeping the exact expressions visible and editable.
  • Review readable schedules, exact expressions, and each job's last and next run in the administration list and Drush output.

Per-job execution control

  • Enable or disable individual jobs and control their execution order.
  • Run due jobs through Drupal's normal cron process.
  • Run individual jobs from the administration UI, with Drush, or through a cron-key-protected URL.
  • Exclude individual jobs from default cron runs and choose which jobs may run during maintenance mode.
  • Lock jobs while they run and unlock stale locks from the administration UI.
  • Show Status report warnings for invalid schedules and enabled jobs that are more than 10 minutes behind schedule.

Drupal and developer integration

  • Optionally expose Drupal hook_cron() implementations and cron-enabled queue workers as configurable jobs.
  • Define custom jobs with the Simple Cron Plugin API using PHP attributes or legacy annotations.
  • Provide a default schedule, execution weight, job-specific configuration form, or multiple job types from one plugin.
  • Use the included Simple Cron Examples submodule as a starting point for custom jobs.

Post-installation

  1. Go to Configuration > System > Cron > Simple cron jobs or visit /admin/config/system/cron/jobs.
  2. Edit a job to configure its schedule, enabled status, single-URL-only mode, maintenance-mode behavior, and plugin settings.
  3. Open the Simple cron settings tab to configure execution and lock timeouts and, when needed, expose cron hooks or queue workers as Simple Cron jobs.
  4. Make sure Drupal cron is triggered by the server, a hosting platform, or Automated Cron. Simple Cron decides which jobs are due when Drupal cron runs; it does not create the external cron trigger.

Declaring a custom job

Custom jobs are provided as Simple Cron plugins. A minimal plugin needs an attribute and a process() method:

<?php

namespace Drupal\example\Plugin\SimpleCron;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\simple_cron\Attribute\SimpleCron;
use Drupal\simple_cron\Plugin\SimpleCronPluginBase;

#[SimpleCron(
  id: 'example_cleanup',
  label: new TranslatableMarkup('Example cleanup'),
  crontab: '0 * * * *',
)]
final class ExampleCleanup extends SimpleCronPluginBase {

  public function process(): void {
    // Run scheduled work.
  }

}

Plugins can also provide job-specific configuration forms. See the configurable job source code in the included simple_cron_examples submodule for a complete example. The submodule also includes an example that provides multiple job types.

Alternatives and similar modules

Ultimate Cron provides more advanced cron orchestration, including parallel execution, launcher and logging options, pool management, and load balancing. Simple Cron focuses on a lighter per-job administration experience, visual and readable scheduling, and execution through Drupal's normal cron process. The two modules are incompatible and cannot be enabled together.

Drupal 10–11

Ask your assistant about Simple Cron

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Mar 2023
Latest release
1 month ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0-rc1 Pre-release 11 PHP >=8.3 Sep 6, 2026
1.1.0 Stable 10–11 Nov 18, 2025
1.1.0-beta3 Pre-release 10–11 Dec 13, 2024
1.1.0-beta2 Pre-release 10–11 Dec 13, 2024
1.1.0-beta1 Pre-release 8–10 PHP 7.2 Mar 24, 2023
1.1.x-dev Dev 10–11 PHP >=8.1 Mar 24, 2023