Created
October 24, 2020 23:24
-
-
Save lhns/d6d8c05c1388532c719b3668ea4a666f to your computer and use it in GitHub Desktop.
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/sh | |
set -e -o pipefail | |
database="$1" | |
stat "$database" | |
[ -s "$database" ] | |
cp "$database" "${database}.bak" | |
sqlite3 "$database" -cmd ".mode insert" -cmd ".output dump_all.sql" -cmd ".dump" ".exit" | |
cat dump_all.sql | grep -v TRANSACTION | grep -v ROLLBACK | grep -v COMMIT >dump_all_notrans.sql | |
rm "$database" | |
sqlite3 "$database" ".read dump_all_notrans.sql" | |
stat "$database" | |
[ -s "$database" ] | |
echo done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
docker run --rm -it --mount type=bind,source=x:\storagenode\storage,destination=/storage sstc/sqlite3 sh