Heh. I think reading the patch will help you understand. 0 and 7 do double-duty representing the same day; this leaves the 7-day-week intact.
On Tue, May 26, 2009 at 6:32 PM, Luke Kanies <[email protected]> wrote: > > I haven't commented on the patch yet, but... > > The range is actually 0 to 6 - there are only seven days in the week. > > I don't know the reason for the change from 0-6 to 0-7; if math must > be done because our period starts at 0, then so be it, but we can't > make the week 8 days long. > > On May 26, 2009, at 7:11 PM, Paul Lathrop wrote: > >> >> Totally insignificant detail, but you should also change the line >> that says: >> >> "Optional; if specified, must be between 0 and 6, inclusive, with" to >> be "between 0 and 7" >> >> --Paul >> >> On Tue, May 26, 2009 at 2:20 PM, Calimero >> <[email protected]> wrote: >>> >>> Hi, >>> >>> As described in ticket #2293 in redmine, the Cron resources currently >>> has two restrictions compared to what vixie-cron (shipped with >>> CentOS, >>> Debian...) actually supports: >>> >>> 1/ Syntax X-Y/Z is not supported (while X-Y/*) >>> >>> 2/ Sunday must be given as 0 (or 'sun') while vixie-cron supports >>> both >>> 0 and 7 >>> >>> Second restriction is probably no big deal (actually when changed 7 >>> to >>> 0 on the fly while converting our crontabs to puppet resources). >>> But X- >>> Y/Z not being supported is a bit more of a problem for us. >>> >>> So we ended up with the following patch (against 0.24.8): >>> >>> diff -ru puppet-0.24.8/lib/puppet/type/cron.rb puppet-0.24.8-cron- >>> patch/lib/puppet/type/cron.rb >>> --- puppet-0.24.8/lib/puppet/type/cron.rb 2009-03-23 >>> 22:35:33.000000000 +0100 >>> +++ puppet-0.24.8-cron-patch/lib/puppet/type/cron.rb 2009-05-22 >>> 11:27:57.469213000 +0200 >>> @@ -173,6 +173,11 @@ >>> return value >>> end >>> >>> + # Allow ranges + */2 >>> + if value =~ /^[0-9]+-[0-9]+\/[0-9]+$/ >>> + return value >>> + end >>> + >>> if value == "*" >>> return value >>> end >>> @@ -268,10 +273,10 @@ >>> def alpha >>> %w{sunday monday tuesday wednesday thursday friday >>> saturday} >>> end >>> - self.boundaries = [0, 6] >>> + self.boundaries = [0, 7] >>> desc "The weekday on which to run the command. >>> Optional; if specified, must be between 0 and 6, >>> inclusive, with >>> - 0 being Sunday, or must be the name of the day (e.g., >>> Tuesday)." >>> + 0 (or 7) being Sunday, or must be the name of the day >>> (e.g., Tuesday)." >>> end >>> >>> newproperty(:month, :parent => CronParam) do >>> >>> >>> Patch is also attached to redmine ticket #2293 if you prefer >>> redmine's >>> fancy and colorful diff viewer. :-) >>> >>> Well as you can see this is no rocket science. Anyway I don't know >>> what other cron daemon support (or don't...). >>> >>> Bye, >>> Calimero ! >>> >>>> >>> >> >> > > > > -- > I was an only child... eventually. -- Stephen Wright > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
