pyatcron-devel-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Pyatcron-devel-list] Some comments on Brian code


From: Julien Olivier
Subject: RE: [Pyatcron-devel-list] Some comments on Brian code
Date: Tue, 18 Nov 2003 22:51:59 +0000

On Tue, 2003-11-18 at 22:34, Childers, Matthew wrote:
> > > >
> > > > > Actually, they expect strings. My reasoning behind that was that
> > > cron
> > > > > accepts ranges (e.g. 2-5), lists (e.g. 1,2,3), step values (e.g.
> > > */5)
> > > > > and so on. So, are we not going to have those kinds of
> > > functionality?
> > > > > And what about the default value of '*'? If implemented as an
> > > integer,
> > > > > would we just use 0 for that?
> > > >
> > > > I guess it should be possible to "emulate" all that
> functionalities
> > > > using string arrays, isn't it ?
> > > >
> > >
> > > That is a good point Brian.  I would imagine we would just need to
> > > accept strings.  Not necessarily string arrays, since we should be
> able
> > > to set all the options for a value with one string.
> > 
> > Really, I don't see how it is harder to use int arrays instead of "*",
> > or "2-5", as it is just a "human" representation of an array of
> > integers, nothing more. For example, if you want to say "all the days
> of
> > the week except from the 5th one", you could write "*/5" or
> > "1,2,3,4,6,7". For a computer program, it's easier to handle this
> > information if it stored as an array containing {1,2,3,4,6,7} than in
> a
> > string containing "*/5", IMO at least.
> > 
> 
> I see what you are saying now.  That would work, however, I have a
> question more so with cron than how you are saying to do it.  If you
> have a minute expressed as */10 that would be run every 10 minutes which
> could be re-written (10,20,30,40,50,60).  Now if you have a minute
> expressed as */45, will this actually run every 45 minutes, or only on
> the 45th minute of the hour?  If it runs every 45 minutes, then I don't
> know how you would express it in an array, as the minutes would change
> each hour.  The first hour it would run on the 45th minute, the second
> hour, on the 30th minute, the third on the 15th minute and so on.  I
> looked around and couldn't find any information on this, so if it does
> not actually run every 45 minutes, then Julien's way would work fine,
> otherwise, we would have to look at something else.
> 

Ah yeah. I guess you got a good point here... I thought "*/45" meant
"everything except 45" :) As you say, it's just not possible to
"emulate" the "*/x" behaviour correctly (provided that cron interprets
it correctly) with int arrays. So we'll have to use strings (which is
not a problem in fact).

-- 
Julien Olivier <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]