Skip to content

Instantly share code, notes, and snippets.

@mgng
Created July 7, 2010 07:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgng/466414 to your computer and use it in GitHub Desktop.
Save mgng/466414 to your computer and use it in GitHub Desktop.
rem --------------------------------------------------------
rem Echofon for Firefox の sqlite をお掃除するバッチ
rem --------------------------------------------------------
@echo off
echo *** 実行するよー
pause
setlocal
set SQLITE_PATH="C:\tool\sqlite-3_6_23_1\sqlite3.exe"
set LIMIT_ID=17000000000
set ROOT_DIR="C:\Documents and Settings\%username%\Application Data\Mozilla\Firefox\Profiles"
cd %ROOT_DIR%
for /f "usebackq tokens=*" %%i in (`dir /B`) do @set CHILD_DIR=%%i
cd %CHILD_DIR%
echo *** create backup
copy /Y twitterfox_1.9.sqlite twitterfox_1.9.sqlite.bak
echo *** delete
%SQLITE_PATH% twitterfox_1.9.sqlite "DELETE FROM timeline WHERE id < %LIMIT_ID% ;"
%SQLITE_PATH% twitterfox_1.9.sqlite "DELETE FROM statuses WHERE id < %LIMIT_ID% ;"
echo *** vacuum / reindex
%SQLITE_PATH% twitterfox_1.9.sqlite vacuum
%SQLITE_PATH% twitterfox_1.9.sqlite reindex
endlocal
echo *** done
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment