Thread: a better cron?
View Single Post

   
  #9 (permalink)  
Old 02-19-2008, 03:02 PM
chris dunn
 
Posts: n/a
Default Re: a better cron?

On 2004-09-29, Sylvain Robitaille <syl@alcor.concordia.ca> wrote:

> chris dunn wrote:
>
>> Dillon's Cron (and every other cron as far as I can see)
>> seems slightly backward in its abilities.

>
> You may be thinking about it wrong; In particular, you may be trying to
> do things that cron isn't intended for ...
>
>> It can't accommodate a one-off task in a following year.

>
> That's right, but at(1) can.
>
>> It can't accept dates such as "third sunday in month" or
>> "last day" or "first monday", all of which can be useful
>> at times.

>
> For these, you may need to do some shell script magic, to get your cron
> job to run exactly when you want, then have it called more frequently
> (weekly, daily, etc) than it will actually do any work.
>
> First Monday of the month, though is still pretty easy: It will be the
> only Monday that falls between the 1st and 7th of the month. Your job
> runs on Mondays, and checks that the date is less than 8 before doing
> any work.
>
> "Last day" can also be done easily in the called script itself, (check
> the date tomorrow; if it's the 1st, then today is the last day of the
> month), or you can use 3 lines in the crontab for the one job, if you
> don't mind February jobs not always falling on exactly the last day.
>
> Third Sunday in the month is a little tougher, and I would propose
> that this could be determined with some reasonably skillful shell
> programming.
>
>> Does anybody know an alternative that will accept these
>> scheduled times?

>
> Well, I hope that the above suggestions help ...


Thanks for this.

It all falls into place with some additional scripting.

Perfect.

Reply With Quote