Skip to content

Instantly share code, notes, and snippets.

@sylr
Created September 16, 2010 11:58
Show Gist options
  • Save sylr/582311 to your computer and use it in GitHub Desktop.
Save sylr/582311 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
if test -f ~/.evolution/.running; then
echo >&2 "evolution is running, close it before running this script"
exit 1
fi
for file in $(find ~/.evolution/ -type f -name \*.db);
do
mime=$(file $file | grep -i "SQLite")
size=$(du -h $file | sed -e "s#\(.*\)\t.*#\1#")
if test -n "$mime"; then
echo vacuuming $file "($size)"
sqlite3 $file VACUUM;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment