2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-09 19:10:30 +00:00
NanoDroid/Full/system/etc/init.d/sqlite

29 lines
655 B
Plaintext
Raw Normal View History

2018-01-23 20:11:52 +00:00
#!/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