By chadj on
Maybe I'm missing something obvious. I'm using Poormanscron for the regular Drupal maintenance stuff and would like to add one or two calls to maintenance scripts of my own.
Is there any way to do this without creating a custom module? I just don't see any option for adding some code to be fired with each cron job.
Thanks,
Chadj
Comments
Any reason for not using
Any reason for not using hook_cron? It seems like this is the best method.
http://api.drupal.org/api/4.7/function/hook_cron
http://api.drupal.org/api/5/function/hook_cron
Just looking for a simpler approach
I'm not trying to hook in a module. I just have a couple of daily admin scripts to call. They are safe to be called often so it makes sense to call them whenever the regular drupal cron job is called.
It just seems like overkill to create yet-another-module to hold two lines of code. I was hoping that Drupal's cron functionality -- or maybe Poormanscron -- had some way to add a line or two of PHP.
- Chadj
hook_cron
I'm with H3rnand3z - create a new module that has one hook - hook_cron. Then call what you need in there.
-mike
I tried adding this to a
I tried adding this to a module file, with a proper info file as well but it is not firing for me...Any ideas?
function mymodule_cron() {
module_invoke_all('pathauto_bulkupdate');
}
My Drupal sites: