Clean up LiV Measurements DB

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Clean up LiV Measurements DB

AlfredC
Administrator
This post was updated on .
Hi,

If you are running LiV V1_0 release, you can do this by running "cleanLiVDB" script under "/home/pi/liv/livDB". The script will stop all liv processes, backup the current "liv.db", create a clean DB and then start again all processes. No need to reboot LiV Pi.






If you are running an older release, you clean up the DB manually:
Here is how you can wipe LIV DB clean:  
1) kill all LiV processes:
ps -aux | grep liv  (shows all liv processes)
sudo pkill -f livDB livAPIs livLCD livXMPP

2)remove and re-create LiV DB
cd ~/liv/livDB
rm liv.db
sqlite3 liv.db < database.sql
sqlite3 liv.db
> .tables
> .schema Measurements
> select * from Measurements; (you will see one test record with 2014 time stamp)
>delete from Measurements where Mid=1;
>CTRL-D to exit db

3) shutdown and powercycle
sudo shutdown now

Turn power supply off and on.