39

I want to be able to accomplish this: http://mywebsite.com/admin/reports/status/run-cron

But it should be done through the Drush interface.

Can any one help me out ?

4 Answers 4

63

You can try drush core-cron

$ drush help core-cron
Run all cron hooks in all active modules for specified site.

Aliases: cron

2
  • 1
    Does it execute api.drupal.org/api/drupal/modules!system!system.module/function/… too? Commented Nov 17, 2016 at 14:12
  • 1
    @meen It will run all hook_cron() implementations, so system_cron() will be called. It is equivalent to running from from the admin UI or /cron.php Commented Nov 17, 2016 at 14:35
26

You can use drush core-cron or just drush cron

If you wish to use drush to run cron from a crontab, it's best to run cron as the web server user, and supply it with additional arguments to make up the lack of a terminal and supply environment variables.

The drush documentation explains it best either at docs/cron.html or run drush topic docs-cron.

Personally I use server wide site aliases so I omit --root and --uri and use @some.site instead for a single site. If you have defined group aliases, you can run cron on the whole group by using @some.group. More information on site aliases if you are interested, otherwise drush docs-aliases.

1
  • Wish I could double up-vote for pointing me to drush topic docs-cron! Commented Jan 28, 2020 at 11:28
9

You could use drush core-cron command that would run the cron . For more detailing about the commands that drush provides us is there on https://drushcommands.com/

0

You can use --quiet

The --quiet flag will suppress these and other progress messages, again avoiding an unnecessary email message.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.