Is it possible to run drush cron over a single module, something similar to "drush cron my_module"?
You can do
drush php-eval 'my_module_cron();'
and it should run.
my_module_cron();in this context?– RandellMar 28, 2014 at 1:03
@Randell If would be the custom hook_cron() that you have defined in my_module. Mar 28, 2014 at 1:05
Thanks @MPD! Can I replace it with 'some_nonhook_function()' if I'm using Elysia cron?– RandellMar 28, 2014 at 1:09
@Randell You can use php-eval to call / execute anything. I do it all the time to test things. Mar 28, 2014 at 3:12
Note though that whatever function you call may not have the proper variables in scope if it's not a cron function. I think hook_cron() implementations, on the other hand, should be self-contained. Dec 8, 2016 at 18:23
I think you can just use,
drush cron module_name
1Can you confirm which version of drush this works in? I just looked at core.drush.inc in the version from PEAR, and I am not seeing arguments for that command. Oct 4, 2012 at 12:55
My version reads 5.1– SelvamOct 5, 2012 at 17:18
3It doesn't work with an argument
module_name.– Елин Й.Sep 19, 2013 at 14:06
You can implement your own drush commands. Have look at the sandwich example code in the drush source package.