Script to vacuum sqlite files to help make firefox faster
parent
b20a4ddb0c
commit
0927ef7b20
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
username=$(whoami)
|
||||
proc="$(ps aux | grep $username | grep -v $0 | grep firefox | grep -v grep)"
|
||||
if [ "$proc" != "" ]
|
||||
then
|
||||
echo "shutdown firefox first!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curdir=$(pwd)
|
||||
|
||||
for dir in $(cat ~/.mozilla/firefox/profiles.ini | grep Path= | sed -e 's/Path=//')
|
||||
do
|
||||
cd ~/.mozilla/firefox/$dir 2>/dev/null
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
echo "In $(pwd)"
|
||||
echo -e " running...\n"
|
||||
|
||||
for F in $(find . -type f -name '*.sqlite' -print)
|
||||
do
|
||||
sqlite3 $F "VACUUM;"
|
||||
done
|
||||
|
||||
echo -e "done in $(pwd) ...\n"
|
||||
else
|
||||
echo -e "\n !!!! Error while entering directory $dir !!!!\n"
|
||||
fi
|
||||
done
|
||||
echo "Job finished";
|
||||
|
||||
cd $curdir
|
||||
|
Loading…
Reference in New Issue