On Sun, Jun 29, 2008 at 3:35 PM, DoOrsOfpErcEpTioN <[EMAIL PROTECTED]> wrote:
> hmmm nice work around..
>
> That means he will have to use two scripts..
> A -- the actual script and..
> B -- the week check script
>
> script B will check for alternate week as per Nadeem's logic. If the
> logic is met (i.e. alternate week = true) then call (excute) script A.
>
> In cron call script B on every friday.

That is one possibilty. I wouldn't suggest having two separate
scripts. What I meant was something like this in your crontab.

01 23 * * fri ${${date +%W}%2} && /path/to/actual/script.sh

This will run the actual script at 23:01 on all ODD fridays. If you
want it to run on EVEN fridays, replace && by ||.
I haven't tested the variable substitution ( I'm sure the syntax above
is incorrect :-) ),  but it would take only a few minutes to get the
correct syntax if you have access to a shell at the moment.

Regards,
NMK.
--
First they ignore you. Then they laugh at you. Then they fight you.
Then you win. -- Mohandas Karamchand Gandhi

Reply via email to