I would like to vacuum all my database files under /data, to achieve somewhat better performance so I ran the following script:
for i in $(find /data -iname "*.db"); do
#echo $(basename $i);
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" | tee -a /data/vacuum.log
done
As you can see this script vacuums and reindexes each database file under /data. REINDEX works fine, but VACUUM does not. It returns "Error: unable to open database file". (error code 14)
I am dealing with /data. So, it can't be a mount problem.