Put the following line in your cron file:
0 3 22-28 * sun db2 reorg ....
(since the 4th sunday of a month is always between the 22nd and the 28th).
Or better, put the "db2 reorg" command in a script and give the script name as the command.
Beware that some crond implementations will OR the day-of-month and day-of-week fields, i.e., the above will run on every sunday AND on every 22nd etc of the month.
In this case it's safer to move some of the logic into the script:
have a cron entry of the form
0 3 22-28 * * exec $HOME/script.sh
and start the script with:
test `date +%u` = 7 || exit 0
or somewhat safer:
test `date +%a` = 'Sun' || exit 0
If you crond does not understand the range 22-28 notation, replace it by 22,23,24,25,26,27,28
Last edited by Peter.Vanroose; 08-25-06 at 14:47.
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting