crontab entry

Sometimes cron really upsets me and I cant figure out these types of wierd dates, but how do I get cron to run something on every other sunday? I am running Solaris 8.

-S

Hi,

As far as I am aware this is not possible. I think the best solution is to add some logic to the script itself. I found a similar discussion here.

http://forums.hostmatters.com/archive/index.php/t-1091.html

Hope this helps.

Yea, I found some things about it on the web and a lot of them had to do with putting logic into the scripts. It wasnt what i was anticipating to make this happen.

I was hoping there was a 'cron' way of doing it. But I am starting to think that my hopes are going to be dashed and i will have to write additional code to give me odd and even weeks.

But if anyone has any easy way for this, please by all means, the forum is open.

Thanks.
-S

# set to 0 to skip even-numbered weeks, 1 to skip odd-numbered weeks
SKIPWEEK=0 
# the number of the current week (01-52) 
WEEK=`date +%V` 
if [ `expr $WEEK % 2` -eq $SKIPWEEK ]; then
exit 0
fi

no need to write additional code, it's been done for you :wink:

That is very nasty. (compliment)

Thanks for the help.

-S