9 |
# |
# |
10 |
#EOF |
#EOF |
11 |
|
|
12 |
MPACKDIR=/u/u2/jmc/testing/tools_mpack |
#-- build munpack if needed: |
13 |
exe=munpack |
unpck=$HOME/testing/tools_mpack/munpack |
14 |
unpck=$MPACKDIR/$exe |
if test ! -x $unpck ; then |
15 |
tmpFil=/tmp/TTT.process_emails.$$ |
MPACKDIR=`dirname $unpck` |
16 |
|
cd $MPACKDIR |
17 |
|
./configure && make |
18 |
|
fi |
19 |
|
unpck=$HOME/testing/munpack.$HOSTTYPE |
20 |
|
#ls -l $unpck |
21 |
|
|
22 |
#-- update tools/mpack-1.6 dir and build munpack : |
#-- create a daily log file (if not already there) |
23 |
cd $MPACKDIR |
cd $HOME/testing/logs |
24 |
bld=`cvs -q update -P -d | tee $tmpFil | sed '/^?/d' | wc -l` |
logpfx="prc_emails_" ; sfx=`date +%m%d` |
25 |
#echo "bld ='$bld'" |
logfile="../logs/${logpfx}$sfx" |
26 |
cat $tmpFil ; /bin/rm -f $tmpFil |
if test -e $logfile ; then : |
27 |
|
else |
28 |
if test ! -x $exe ; then bld=1 ; fi |
#-- clean-up old log files: |
29 |
if test "x$bld" != x0 ; then ./configure && make ; fi |
echo -n '-- in dir: ' ; pwd |
30 |
|
n=$(( `ls ${logpfx}* | wc -l` - 10 )) |
31 |
|
if test $n -gt 0 ; then |
32 |
|
echo -n ' remove files: ' |
33 |
|
ls -lt ${logpfx}* | tail -"$n" |
34 |
|
ls -t ${logpfx}* | tail -"$n" | xargs rm -f |
35 |
|
fi |
36 |
|
echo ' create new log file:' $logfile |
37 |
|
touch $logfile |
38 |
|
echo "Log file created from '"`hostname`"' by '$USER' on:" `date` >> $logfile |
39 |
|
chmod 664 $logfile |
40 |
|
fi |
41 |
|
|
42 |
#-- parse emails : |
#-- parse emails : |
43 |
cd /u/u2/jmc/testing/front_content && ./parse_emails -u $unpck -v -a jmc@ocean.mit.edu |
cd $HOME/testing/front_content && ./parse_emails -u $unpck -a jmc@ocean.mit.edu >> $logfile 2>&1 |
44 |
|
#cd $HOME/testing/temp && ./parse_emails -u $unpck -a jmc@ocean.mit.edu >> $logfile 2>&1 |