You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


ForceClear of database for all instances on the local system



DBclear script
# script assumes that opennsa code is at /usr/src/opennsa 
# LOC1m LOC2 ... LOCn represents uPA instances for individual locations. Scripts assumes that aggregator instances is called "main"  


cd /usr/src/opennsa
cp datafiles/schema.sql /tmp/
for l in LOC1 LOC2 main; do
        echo "Dropping tables from opennsa-$l"
        su - opennsa -c "
        psql opennsa-$l -c '\i ~opennsa/droptables.sql'
        "
        su - opennsa -c "
        psql opennsa-$l -c '\i /tmp/schema.sql'
        "

done


for l in LOC1 LOC2 main; do
        /etc/init.d/opennsa-$l restart
        sleep 1
done


  • No labels