Skip to content

Cron/Drupal-Module

Repository files navigation

Drupal Cron Module

This module will allow you to add, remove, enable, disable and run cron jobs on your Drupal 8 website using Drush. This way you can add one single cron job to the crontab of your server which will trigger the configured cron jobs on your Drupal site when needed.

For now, only the execution of shell jobs is supported

Installation

  1. Make sure Drush is installed (for Drupal 8)

  2. Place this module in the desired module folder

  3. Add the cron library dependency to the composer.json file of your Drupal installation

// composer.json
{
    // ...
    require: {
        // ...
        "cron/cron": "1.0.*"
    }
}
  1. Update your composer installation
composer update
  1. Start using the bundle
drush cron:list
drush cron:run

Available commands

list

drush cron:list

Show a list of all jobs. Job names are shown with [x] if they are enabled and [ ] otherwise.

create

drush cron:create

Create a new job.

delete

drush cron:delete [job]

Delete a job. For your own protection, the job must be disabled first.

enable

drush cron:enable [job]

Enable a job.

disable

drush cron:disable [job]

Disable a job.

run

drush cron:run [--force] [job]

Run the cron. If a job is given only this will be triggered. You can trigger a specific job that is disabled by using --force.

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send us a pull request.

To ensure a consistent code base, you should make sure the code follows the Drupal Coding Standards.

If you would like to help, take a look at the list of issues.

Requirements

PHP 5.4 or above

Author and contributors

Joeri van Dooren

See also the list of contributors who participated in this project.

License

This module is licensed under the MIT license.