Created
May 3, 2013 03:01
-
-
Save huacnlee/5506914 to your computer and use it in GitHub Desktop.
自动修复损坏的 SQLite 3 数据库:“database disk image is malformed”
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mv "$1" "old_$1" | |
cat <( sqlite3 "old_$1" .dump | grep "^ROLLBACK" -v ) <( echo "COMMIT;" ) | sqlite3 "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment