Run Elysia cron from Drush

Elysia Cron is an extension to Drupal’s standard cron system. With standard Drupal cron, all cron jobs are run at the same time. Elysia Cron gives much more control and allows you to set different intervals for each cron. Elysia cron does not actually run cron, instead it schedules what should be run when the standard cron is run. It does this by skipping certain cron tasks if they are setup to run less frequently than the current crontab settings. You just need to setup the normal Drupal cron to run at regular enough intervals.

But sometimes you need to manually fire a particular cron job. For example, let’s say you have a cron task that runs a Feed to pull data into your Drupal site from another source. It is scheduled to run every 4 hours but your client wants it run now for testing purposes.

You have two options. You can run the task from the user interface, or from Drush.

Running from Drush

To run a cron job from Drush, all you need to know is the cron jobs name. Head over to Configuration > System > Cron Settings in the administration section of your site and you will see a list of all of the cron jobs that are managed by Elysia cron. In the left hand column, under Job/Rule you will find the cron jobs name.

Here is an example:

List of Elysia cron jobs

To run the feeds_cron job in Drush, use the elysia-cron run command along with the name:

  1. drush elysia-cron run feeds_cron

Let’s look at another example. Let’s say you want to run the backup and migrate cron job.

To run the backup_migrate_standard job in Drush, use the elysia-cron run command along with the name:

  1. drush elysia-cron run backup_migrate_standard

If you want to run cron jobs on a regular basis, you can always save these commands in a code snippet or text expansion tool like Text Expander to make your life easier.

Running from UI

You can also run the cron job directly in the UI by click on the run link.


Conquer Drupal 8 Module Development

Don't struggle to conquer Drupal 8 module development. Action packed lessons where you will work along building your own real world modules.

20% launch discount available now!

Find out more


Add new comment