[ale] crontab

Richard Bronosky Richard at Bronosky.com
Thu Apr 23 15:59:51 EDT 2009


On Thu, Apr 23, 2009 at 2:56 PM, Pete Hardie <pete.hardie at gmail.com> wrote:
> On Thu, Apr 23, 2009 at 14:02, JK <jknapka at kneuro.net> wrote:
>> IOW, putting "[ date test ] && command" in crontab seems superior
>> IMO to having the date test inside the script being run. Someday
>> you might want to run it on different days.
>
> I'd opt for a wrapper script that took the weekday and the commands,
> so you could make it
> a little more clear what was going on
>
> like this:
>
> 0 0 1-7 * * runOnNthWeekday 1 Thu <command> <args>


"1-7" and "runOnNthWeekday 1" are redundant. That is to say,
"runOnNthWeekday 2" would require a change to "8-14". Removing such
redundancy would running on "0 0 * * *" aka: daily. You might as well
name your wrapper script wheel.sh ;-)

JK's latter solution is clean and communicates when you can expect an
event to happen just by looking at the crontab. It's a KISS winner.

-- 
.!# RichardBronosky #!.


More information about the Ale mailing list