Sample Header Ad - 728x90

Trying to vacuum all databases under /data with sqlite3, but fails with error 14

2 votes
1 answer
2792 views
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.
Asked by juniecho (163 rep)
Jun 29, 2013, 04:04 AM
Last activity: Oct 30, 2014, 06:09 AM