#!/bin/sh
# $Id: doall2,v 1.16 2003/08/28 23:58:14 decibel Exp $

dropdb stats
createdb -D PGDATA_stats stats || exit 1
psql stats < tables.sql || exit 1
psql stats < functions.sql || exit 1

# Fire off some stuff in the background
psql stats < email_contrib.sql 2>&1 | grep -v NOTICE | tee email_contrib.log &
(psql stats < email_rank.sql 2>&1 | grep -v NOTICE | tee email_rank.log && \
psql stats < platform_contrib.sql 2>&1 | grep -v NOTICE | tee platform_contrib.log) &
./stats_participant.sh 2>&1 | tee stats_participant.log &

psql -e stats < copy.sql || exit 1
./doall3
