You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NanoDroid/Full/system/etc/init.d/sqlite

29 lines
655 B
Bash

#!/system/bin/sh
echo "sqlite init script"
if which sqlite3 >/dev/null; then
echo "SQLite database VACUUM and REINDEX started at $(date +"%m-%d-%Y %H:%M:%S")"
for i in `find /data/* -iname "*.db"`; do
sqlite3 $i 'VACUUM;'
resVac=$?
if [ $resVac == 0 ]; then
resVac="SUCCESS"
else
resVac="ERRCODE-$resVac"
fi;
sqlite3 $i 'REINDEX;'
resIndex=$?
if [ $resIndex == 0 ]; then
resIndex="SUCCESS"
else
resIndex="ERRCODE-$resIndex"
fi
echo "Database $i: VACUUM=$resVac REINDEX=$resIndex"
done
echo "SQLite database VACUUM and REINDEX finished at $(date +"%m-%d-%Y %H:%M:%S")"
else echo "sqlite3 not installed, stop"
fi