#!/bin/bash # # compact-ff.sh v. 1.0.0 # Compacts all Firefox DBs # # http://www.riksoft.it # LGPL licence # # Syntax: ./compact-ff.sh # Requires sqlite3 v.10 # If you see errors like "encrypted or malformed DB..." it means you have to get # a newer version of sqlite to be compatible with your Firefox version. sqlitebin='/opt/lampp/bin/sqlite3-v10'; #path to your sqlite3 binary tot_word='total'; #important for grep: use that of your language. en="total" it="totale" read -p "Close any instance of Firefox and press any key." bef=$(find ~/.mozilla -type f -name \*.sqlite -exec du -ch {} + | grep "$tot_word"$) find ~/.mozilla -type f -name \*.sqlite -exec $sqlitebin {} "VACUUM" \; find ~/.mozilla -type f -name \*.sqlite -exec $sqlitebin {} "REINDEX" \; aft=$(find ~/.mozilla -type f -name \*.sqlite -exec du -ch {} + | grep "$tot_word"$) echo "Before: "$bef, "After: $aft" read -p "Press any key to close."