Cronjob on alternate sundays

I want to set the crontab job for one of my SIEBEL database to refresh it on alternate sundays. Is there anyway I can do it through cron please ?
If not whats the alternative ? :confused:

Thanks in advance.

You can run it every Sunday through cron and then put some logic into the script you are running to check if it's a alternate Sunday or not (as easy as creating a file after your last good run to touch a file (create the file) if it's not there or to delete it if it is there.

Sunday 1 -check for file - not there then run job - touch file
Sunday 2 -check for file - there - remove file - end
Sunday 3 - check for file - not there then run job - touch file
Sunday 4 - check for file - there - remove file - end

My datecalc script can calculate a day number when given a date. And it can also calculate a day-or-week number much like cron uses. With a little algebraic legerdemain it is possible to use those numbers to classify weeks into two sets "even" and "odd" without any need for a state file. I have extended my weekselector script to do this. So using weekselector is now another option.

weekselector

Not tested...

5 4 * * sun (($(/usr/bin/date +%W)%2)) && echo "run at 5 after 4 every other sunday - odd weeks"
5 4 * * sun (($(/usr/bin/date +%W)%2)) || echo "run at 5 after 4 every other sunday - even weeks"

There's a couple of problems there, Ygor. A % in a crontab entry will not work as expected. This nailed me too. See that weekselector thread for details. Also, I'm not sure that this will work across the year to year transitions for all years. I screwed up my system changing dates, so I'm not going to keep looking for a counter-example. (But for the 2 years that I did check, it did seem to work.) And that syntax requires a modern shell. Some systems still have a old Bourne shell processing crontab entries.

i have run the script as RTM suggested..so my script looks like this:
-------------------------------------------
if [ -f /filename ]
then
rm filename;
do job1;

else
touch filename;
do job2;
job3;
fi
-------------------------------------------

and I am calling this script on each monday. The prob still is everymonday the scirpt goes thru job1, job2 and job3. why does it do so ?

hello,
i am new in solaris system administrations please i need to get informations on how to create new account on a solaris system, i have tried creating using the useradd command but have not been successfull, pls help