>
> That just saved my day ! Thanks !
>
> Just an easy script to automate the proces, those Pi are sometimes 
unresponsive and the only way is to sadly cut the power :o

#!/bin/sh
#
# repairsdb.sh
# 
# requires sqlite3 (apt install sqlite3)
# adjust following line with path/file.sdb
DBFILE="../database/weewx.sdb"
# dump
echo "Dump corrupted sqlite file $DBFILE to $DBFILE.dump.gz"
echo '.dump' | sqlite3 $DBFILE | gzip -c >$DBFILE.dump.gz
# backup sdb
echo "Rename corrupted sqlite file $DBFILE to $DBFILE.backup"
mv $DBFILE $DBFILE.backup
# rebuild sdb from dump
echo "Building proper sqlite file $DBFILE from dump $DBFILE.dump.gz"
zcat $DBFILE.dump.gz | sqlite3 $DBFILE
echo "Done !"

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to