Hi Guys,
The following command will give you the two dates you are after. (ie. 2nd and 4th Friday of the current month).
cal | tail +3 | cut -c21-22 | grep "[0-9]" | sed -n '2p;4p'
You can change the day from friday to another by tweaking the cut command, or change the week in the month by tweaking the sed command.
Setup a script to exec via cron every friday, with something like the following verify function to prevent actually executing on the wrong days.
Today=`date +%e`
RunDays=`cal | tail +3 | cut -c21-22 | grep "[0-9]" | sed -n '2p;4p'`
if [[ `echo "$RunDays" | grep $Today` -ne $Today ]]
then # Exit Cleanly
exit 0
fi
# Now running rest of script seeing as its either 1st or 4th Friday of this month.
Hope the above is of some use to you
Best Regards to all.
____________________
Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debuging Mondays code.