Which modules use hook_cron?

May
14
2007
Drupal Grep

I recently needed to find out a list of modules which used <code>hook_cron</code>. I have SSH access to my server. Instead of writing a module (or using devel to execute some PHP) which returned the result of module_implements, I turned to <code>grep</code>. Simply <code>cd</code> into your modules folder (can be the Drupal install, but you end up recursing through unlikely folders) and run this:

grep -R "^function.*_cron" *module

That will recursively search for all files with any lines that start with function, have anything between that occurrence of function and _cron. You can replace _cron with any hook name you like. I hope this is of use to someone else too.

The Drupal face came from a derrivative of Steven Wittens Wallpapers. If you'd like me to take it down Steven, please let me know - I didn't think you'd mind as there doesn't seem to be any CC license notes on the page in question. Nice wallpapers by the way!

Comment Icon

0 Comments

There are no comments yet. Why not be the first?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <img> <p>
  • You can use BBCode tags in the text. URLs will automatically be converted to links.
  • You can enable syntax highlighting of source code with the following tags: <pre>, <code>.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.

Follow Me

Recent comments

Answers 1 day ago
Replies.... 6 days ago
Or in 6 days ago
A few tweaks 1 week ago
Nice 1 week ago
Thanks a million 1 week ago
Syndicate content