Skip to content

Commit

Permalink
Merge pull request #15 from Dunedan/improve-sqlite-backup
Browse files Browse the repository at this point in the history
Use online backup API for SQLite backups
  • Loading branch information
Dunedan committed Dec 11, 2023
2 parents b9616b2 + 03fc4e0 commit 5e5aa6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions roles/borgmatic/files/dump-sqlite.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh

# Helper script for borgmatic to dump SQLite databases.
#
# Necessary as the version of borgmatic in Debian/bookworm doesn't
# support backing up SQLite databases natively yet.
# support backing up SQLite databases natively and we do want to use
# the "backup" command instead of the "dump" command used by borgmatic
# anyway.

set -e

Expand All @@ -26,4 +29,4 @@ fi

mkdir -p /tmp/borgmatic/sqlite/

sqlite3 "$DB_PATH" .dump > "/tmp/borgmatic/sqlite/$DB_NAME.sql"
sqlite3 "$DB_PATH" ".timeout 10000" ".backup /tmp/borgmatic/sqlite/$DB_NAME.sqlite"

0 comments on commit 5e5aa6b

Please sign in to comment.