Hi,

I was wondering what there are any advantages/disadvantages of running cron frequently on a website?
Would it be possible to run cron every 5 minutes to allow other modules that depend on cron running in order to import data?

Thank you!

Comments

Dave Reid’s picture

Generally, it depends on what modules are running on cron. If you need it run frequently for data imports, just be sure you don't have any modules that need to perform large operations on every cron run. I'll see if I can find a relevant handbook page.

YK85’s picture

I'm looking into integrating the Twitter Module into my site, which requires cron to run to import the latest tweets.
I was wondering how I can make cron run more frequently. So far I am only able to set to 1 hour as most frequent.
If there are any good handbook pages on this topic I would be very interested in reading them!
Thanks Dave

Dave Reid’s picture

If you need to run it more frequently than every hour, you probably should be setting up a real crontab script to run your site's cron.php file.

YK85’s picture

Thanks for the info! I will try to figure out setting up a cron.php file for my site.
It would be really cool if poormanscron would allow the administrator to define the frequency.
Any chance of this to be a feature request that would be considered?

klonos’s picture

Please keep in mind that not everyone has access to crontab and even if they do, it doesn't mean they know how to use it. In fact, I believe that Drupal newbies install poormanscron in order to avoid having to learn cron syntax. They think of it as a cron web GUI :)

I thing frequency time should be more flexible too. Perhaps a setting like:

Run cron every [integer*] [drop-down**], at [hh:mm:ss]

* (default to 1 cause 0 or blank don't make sense)
** minute(s)/hour(s)/day(s) ... perhaps week(s) too, but not sure if people want to run it that infrequently + for 1 week they can always use 7 days

When it comes to running jobs every day, there is the issue of 24h vs 1day. Please look here for more details on that: #698360: Support refresh every new day (as opposed to every 24h)

Dave Reid’s picture

Poormanscron shouldn't be relied on to be used as an 'every 5 minute' cron runner. It still depends on traffic coming to your site and should be thought of as a 'ok still make sure we're runnning cron every so often' kind of thing. You can view that reasoning in the D7 issue linked on the project page. Basically if you need a more reliable cron or are having lots of intense things running during cron, you should at some point figure out if you can use the proper crontab.

klonos’s picture

Fair enough! I won't argue any more on this. I only needed to stress out that there's a lot of people out there without shell access in order to use crontab.

howdydo’s picture

I'm one of those people - I would appreciate a patch of some kind or instructions on how I can tweak the poormanscron to update every 5/10 minutes.

mastorer’s picture

Oh wow... newbie here... man, this stuff is so interwovenly complex.. I admire you all!

I'm only at the stage of setting up Drupal via a MAMP-created local server on my Mac (OS 10.5.8).

I fretted about the over-my-head cron issue with Macs in the Handbook, went to Forum about what to do, was told to forget it all and just download Poormanscron.

Thought I could then wash my hands. Now I read here about issues with Poormanscron, too. What's a newbie to do?

I gather that cron can't be running when downloading or uploading files?
Is there a way to manually turn off or override Poormanscron when such actions are taking place?

Better still, can't you geniuses figure out a function to make Poormanscron automatically halt and delay its scheduled run when it detects any action about to take place that it would interfere with?
I'm as green as can be about anything requiring automation, but it seems this could just be another javascript addition, no?

What scares me is that I have no idea if my website will draw much (if any) traffic except for myself for some months when first brought online. Need I worry that Poormanscron won't be adequately triggered to keep its job done?

Dave Reid’s picture

@mastorer: The 2.x version of poormanscon runs its own separate AJAX request so it's independent of any other operations. So you should not worry about that. But yes, it can only run when traffic is actually hitting your site. But even anonymous users will be able to trigger cron, so there's a good chance at least someone will cause it to be run.

deltab’s picture

Subscribing. And agree with #5.

Is there a way of bypassing poormans cron in Drupal 7, and going the old crontab route? I also have the twitter module, and cron must run every few minuets.