Hi
This is a starting point I guess, so I hope it is of some help. Not sure why you want to use Entourage specifically when you can use the "mail" program that comes pre-compiled in OS X, but hey, whatever you need.
Firstly you'll need to get the list somewhere on the filesystem. In this example script it is in a file called
sus_list.txt under the
/tmp/ directory.
Code:
!/bin/sh
#============================
# Define admin email address
NOTIFY="one@you.com, two@you.com"
# Get computer name
C_NAME=`/usr/sbin/scutil --get ComputerName`
# Define a function
mailOUT ()
{
echo From: ${C_NAME} - Monday Morning ARD SUS Notification \
> /tmp/sus_mailout.txt
echo ----- >> /tmp/sus_mailout.txt
echo Timestamp: `date` >> /tmp/sus_mailout.txt
echo ----- >> /tmp/sus_mailout.txt
echo "Please find below the list of clients that need patching" \
>> /tmp/sus_mailout.txt
echo ----- >> /tmp/sus_mailout.txt
echo "" >> /tmp/sus_mailout.txt
cat /tmp/sus_list.txt >> /tmp/sus_mailout.txt
cat /tmp/sus_mailout.txt | mail -s "From: ${C_NAME} - Monday \
Morning ARD SUS Notification" ${NOTIFY}
}
if [ -f /tmp/sus_list.txt ]
then
mailOUT
else
# log error to the syslog
logger "SUS: File /tmp/sus_list.txt does not exist"
fi
exit 0
This script will have to be made executable or called like this
I usually place scripts like this in
/usr/local/scripts/ but that is a personal preference.
Normally I'd say to use Launchd to handle the scheduling of the script, but the StartCalendarInterval is not tuned enough for this at present, so it's back to good old cron. Personally, I wouldn't have this run by the root account as there is nothing in there that requires root privileges. To that end, in your crontab, add the following so that it will run at 0900 every Monday:
Code:
0 9 * * 1 /usr/local/scripts/mailout.sh
HTH a bit,
Mike