#!/bin/sh CORPUS=/home/felicity/SA/corpus SA_VER=/home/felicity/SA/spamassassin-corpora NET=0 BAYES=0 OPTS="--progress" USERNAME=username FILENAME=$USERNAME while [ ! -z "$1" ]; do if [ "$1" = "--net" ]; then NET=1 elif [ "$1" = "--bayes" ]; then BAYES=1 fi shift done if [ $NET -eq 1 ]; then FILENAME="net-$FILENAME" OPTS="$OPTS --net" # We want to do this with more parallelization, but not if Bayes is also running ... if [ $BAYES -eq 0 ]; then OPTS="$OPTS -j 8" fi fi if [ $BAYES -eq 1 ]; then FILENAME="bayes-$FILENAME" OPTS="$OPTS --bayes" fi # Update SA version before our run echo "[Updating $SA_VER]" cd $SA_VER cvs -q up # update the corpus with the latest/greatest mail files echo "[Updating Corpus]" cd $CORPUS $CORPUS/update -q # remove current bayes db set echo "[Removing old Bayes DB]" rm -f $SA_VER/masses/spamassassin/bayes* # do the run echo "[Running mass-check '$OPTS' in $CORPUS]" $CORPUS/run-masses $SA_VER $OPTS > /dev/null if [ ! -s ham.log -o ! -s spam.log ]; then echo "There seems to be a problem with either ham.log or spam.log, aborting!" >&2 exit 1 fi mv -f ham.log results/ham-$FILENAME.log mv -f spam.log results/spam-$FILENAME.log mv -f results.log results/hf/results-$FILENAME.log cd results # now we have our ham.log and spam.log files... echo "[Uploading daily corpus logs]" export RSYNC_PASSWORD="" rsync -qCPcvuzb *-$USERNAME.log $USERNAME@belphegore.hughes-family.org::corpus/ echo "[Our results]" cat hf/results-$FILENAME.log