php to run cron

Events happening in the community are now at Drupal community events on www.drupal.org.
royerd's picture

Can anyone show me the PHP code I would need to execute cron from a custom PHP Rule?

I have a rule that uses the rules scheduler.

The scheduled rule needs cron to trigger it and I don't want cron running very minute just for the sake of this rule,so I want cron to run when a particular rule is executed. In other words, I want to add a rule "action" that runs cron. But to do that I need to create a custom PHP line because there is no action native in D7 anyway that simply runs cron.

There may be more elegant ways to get what I want, but I haven't figured it out and I know this rule set works once cron is fired. So I just want to manually fire cron at the end of this rule set.

Dan

Comments

Here you go,

THANKS. It's working, but I

royerd's picture

THANKS.

It's working, but I think my rules are overlapping or too close together or something. What if I wanted to delay that cron run by say 5 seconds. I looked at that API code (thanks) but I just can't make much sense of PHP stuff.

Dan

Grand Rapids, MI

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: