On 1/5/2010 1:50 PM, Larry Starr wrote:
On Tuesday 05 January 2010, Thomas Harold wrote:
You mean something more then:
"An update was available, and was downloaded and installed successfully.
You are now running sa-update version svn607589."
Which is the message generated by sa-update on my system, packed up into
an e-mail to the root user when it runs daily. I think it's a standard
script that is part of SA...
If you want to know specifically what changed on the server - maybe a
tripwire setup or use FSVS and version the entire server (well, except
for stuff that doesn't need to be versioned like user data). On our
setup, after running sa-update, I could use FSVS to get a list of what
files have changed and even do a diff between the old/new versions.
That message would be helpful, my sa-update seems to produce no output,
regardless of the presense or absense of updates. I am running version
svn607589, per the Version option of sa-update:
sa-update --version
sa-update version svn607589
running on Perl version 5.10.0
Apparently it is necessary to place sa-update in a wrapper script to generate
such output?
Well, looking at the SA install on my CentOS 5 x86_64 server...
/etc/cron.d/sa-update
- This file was installed by the RPM, but the only entry is commented out.
I'm using a custom shell script (spamassassin_sa-update.sh) which gets
run by root's daily crontab.
#!/bin/sh
echo "Running sa-update to update SpamAssassin rules..."
#Today's date
today=$(date +%Y-%m-%d)
#Run sa-update
/usr/bin/sa-update
exitcode=$? #Exit code from sa-update
#Find version of sa-update
version=$(/usr/bin/sa-update -V | grep "sa-update")
if [ $exitcode = 0 ]; then
echo "An update was available, and was downloaded and installed
successfully. You are now running $version." | mail -s "sa-update for
$today - Updated" root
echo "Updated to $version."
elif [ $exitcode = 1 ]; then
echo "No update was available. You are still running $version." |
mail -s "sa-update for $today - No Update" root
echo "No update today."
else
echo "An error occured while attempting to download and extract
updates. You are still running $version." | mail -s "sa-update for
$today - ERROR" root
echo "Error occurred."
fi
echo "End of /usr/local/sbin/spamassassin_sa-update.sh"
exit 0
I'm not sure where I picked up that script. Probably from the following
link:
http://www.howtoforge.com/forums/showthread.php?t=10710