I started noticing that there were a lot of very large sqlite database files scattered around on my os x installation and testing doing a little sqlite vacuum on them and lo and behold they didn’t appear to be getting regularly vacuumed by the OS at all.. So I created this handy little script to VACUUM those files.

Should be safe to run on your home dir or root “/” folder, but running on your home directory should do wonders for you in terms of disk space and speedup of various applications. The name patterns of which files are sqlite databases is a constant on-going tweek so can’t say for sure this catches all of them. You’ll see a few “not a database or encrypted” errors coming from sqlite which so far seem be safe to ignore from what I can tell.

#!/bin/sh
find . -type f \( -name \*.db -o -name \*.sqlite -o -name \*.sqlite3 -o -name \*.syncdb \
-o -name \*.changedb -o -name \*.synciddb -o -name \*AvailableFeeds\* -o -name \*DefaultCounts\* -o -name \*Envelope\* \) -exec sqlite3 {} VACUUM \;


  1. Gravatar IconKevin Menard

    Good stuff. I thought this blog was dead :-P

    You should set up a github repo or something for this. Make it easier to track.

  2. Gravatar IconJesse Kuhnert

    Hah, me too. Couldn’t fit the script in a tweet though so had to revert to this old thing.. ;)

Leave a Comment