Allow cron to run only during a certain time

mikeytown2 - September 17, 2009 - 20:07
Project:Poormanscron
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

Let's say I only want cron to run between midnight and 4am.

#1

Dave Reid - September 27, 2009 - 20:31

I would think this probably be a more appropriate general-cron solution. I'm thinking a small contrib module with a very low (negative) module weight that implements hook_cron() and calls exit() if a certain time.

I don't think this should be appropriate for poormanscron.

#2

Dave Reid - September 28, 2009 - 03:46

Or if you need more complex cron timing issues, set up your own cron job to run on certain times.

#3

mikeytown2 - September 28, 2009 - 03:54

Thats a feature thats available for people with cron jobs; just trying to bring more of the customizable side of having your own cron job to this project. If a patch appears, would you be willing to commit it?

#4

mikeytown2 - September 30, 2009 - 01:12
Version:6.x-1.x-dev» 6.x-2.x-dev

#5

mikeytown2 - September 30, 2009 - 01:34

The simpler way to do this would be to have the trigger time be the same Hour if on a 24hr clock, or always at the same Minute if on a Per Hour base, ect... ensures consistent cron runs to the best of the ability of this module, given the limitations.

#6

Dave Reid - October 4, 2009 - 02:03
Version:6.x-2.x-dev» 6.x-1.x-dev

I'd be willing along with the other co-maintainers to consider it for 6.x-1.x, but not for 6.x-2.x, since I would really like to keep it a *very* simple version of the Drupal 7 backport.

#7

Dave Reid - November 27, 2009 - 01:19
Status:active» won't fix

I don't think this is appropriate for just this module. This could be easily accomplished as a new module so it supports all forms of cron run, if it has a very low weight and checks the time and exits if it's not the desired time.

 
 

Drupal is a registered trademark of Dries Buytaert.