[Top][All Lists]

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

[Pyatcron-devel-list] Cron and the "*/45" entry

Subject: [Pyatcron-devel-list] Cron and the "*/45" entry
Date: Thu, 20 Nov 2003 17:09:29 +0100

> > I tried the cron task, and set it up with my schedule 
> looking like this:
> > 
> > */45 * * * * /bin/mycommand
> > 
> > I watched my email, and noticed that it is firing the task 
> at the top of
> > every hour and at the 45th minute of every hour.  It is NOT, running
> > every 45 minutes like I would expect it to.
> > 
> > I'm starting to think that */n in the minutes column actually means:
> > 0-59 and step by n minutes.  And if n = 45 then it would 
> run at 0 and 45
> > minutes on every hour (assuming the hour field is *).  And if n = 10
> > then it would run at 0,10,20,30,40,50.  So before we just 
> assume that
> > */45 means run every 45 minutes, and before we start crafting a GUI
> > based on this assumption, we may want to do a little more 
> research into
> > it.  Did anyone else try this little experiment?
> > 
> I did a similar test (*/7) and it seems that you're right. It doesn't
> run every 7 minutes. It goes from min 56 to min 0 instead of min 3.
> We'll have to re-think about it I guess...

Hmm, not re-think, but get back to the first idea I guess, having list of 
integers as parameters.

Explanation: I went through the way Cron works, and in fact, for each time/date 
entry, it builds internally a list of "true" value. In other words, looking at 
the minute fields for example, Cron builds internally a list of minute value 
when the task is allowed to run.

The "*", "nn-mm" or the "X/nn" representations are made to be human readable, 
but when Cron parse the crontab files, it builds list of values.

The "*" becomes "1,2,3,4,5,6,7,8,9,10,...56,57,58,59", "20-25" becomes 
"20,21,22,23,24,25" and finally, "*/22" which means every minutes from 0 with 
an increment step of 22 becomes "0,22,44"; This is really not "execute every 22 
minutes" but "build a list of values from 0 to 59 with an increment step of 22 
and use this list as true values for the minute field".

So, in conclusion, if everyone agrees, I would like to fall back to list of 
integers for the get/set functions of the Scheduler. Then, the role of the GUI 
will be to map human suitable graphical objects with list of values.



This e-mail contains proprietary information some or all of which may be 
legally privileged. It is intended for the recipient only. If an addressing or 
a transmission error has misdirected this e-mail, please notify the author by 
replying to the e-mail. If you are not the intended recipient you must not use, 
disclose, distribute, copy, print, or rely on this e-mail.
We take reasonable precautions to ensure our e-mails are virus free. However, 
we cannot accept responsibility for any virus transmitted by us and recommend 
that you subject any incoming e-mail to your own virus checking procedures.

reply via email to

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