july 2013 scraper fixes
[disclosr.git] / documents / runScrapers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $DIR
cd $DIR
echo "" > /tmp/disclosr-error
for f in $DIR/scrapers/*.py; do
        echo "Processing $f file..";
        md5=`md5sum /tmp/disclosr-error`
        python $f 3>&1 1>&2 2>&3 | tee --append /tmp/disclosr-error;
        md52=`md5sum /tmp/disclosr-error`
        if [ "$md5" != "$md52" ]; then
                echo "^^^^^^^^^^^^^^ $f" >> /tmp/disclosr-error;
        fi
        if [ "$?" -ne "0" ]; then
                echo "error";
                sleep 1;
        fi
done
if [ -s /tmp/disclosr-error ] ; then
    echo "emailling logs..";
    mail -E -s "Disclosr errors" maxious@lambdacomplex.org < /tmp/disclosr-error ;
fi