The crontab entry below executes the script BounceORACLE_SID.ksh after the 4th Tuesday of the month.
01 00 23-29 * * eval [ `date +\%w` -eq 3 ] && ${HOME}/_DBA/SCRIPTS/START_STOP_LSNR_and_DB/BounceORACLE_SID.ksh ORAPRD > ${HOME}/_DBA/SCRIPTS/START_STOP_LSNR_and_DB/LOGS/BounceORACLE_SID_$$_`date +\%Y.\%m.\%d..\%H.\%M.\%S`.log 2>&1
Unpacked the entry says:
Test, [], the evaluation, eval, of the value returned after execution of the command date +%w in the grave accents (“ with an escaped percent sign) 01 minute after 00 (midnight) on the 23rd to the 29th day of every month. If the day is Wednesday, that is, the return value is 3, the second part of the command string (following the double ampersands, &&) will be executed.
The earliest 4th Tuesday would occur if the first Tuesday is the first. The next two Tuesdays would then be the 8th and the 15th. The fourth Tuesday would occur on the 22nd. The bounce occurs at midnight after the (potential) maintenance period. The latest Tuesday would occur if Wednesday was the 1st. Then, the Tuesdays would be the 7th, the 14th, the 21st and the 28th. So every month the fourth Tuesday is between the 23rd and the 29th. And only one of those dates is a Wednesday.
Bye,