crontab entry

Hi. I'm new to AIX and I need to create a crontab entry to run a script every first 5 business days of the month? please help.

Only business days?

You will need a real job scheduler for that. Autosys, BMC, etc. I don't know of any freeware job schedulers. if anyone does, please post!

Create a crontab entry to run the script the first seven days of every month. This is straightforward. Within the script test for the day of week being Saturday or Sunday and stop if this test returns <true>.

This will work generally, the only exception being floating holydays.

To cover even this you will have to provide a list of holydays to the script and put it in crontab so that it is called daily. The script would first test if a new month has begun. If this is the case and the day of week is not a Saturday or Sunday or the date is found in the holyday list (in which case it aborts), it runs and increments a counter in a file until 5 is reached. If a new month has not begun the file with the counter is read and if the counter is already at 5 the script stops also.

In pseudo-code:

if( new month has begun since last run )
     clear counter-file

if( DOW is Saturday or Sunday or day is in holyday-list ) {
     abort
} else {
     if( counter file is less then 5 ) {
          do_work()
          increment counter file
     } else {
          abort
     }
}

I hope this helps.

bakunin