There are a few options for backing up databases like this, and assuming there's an easy mechanism to ensure consistency (temporarily halting the database/locking write access, etc), they're all roughly similar.
The key thing (as Craig Estey mentions in his comment) is to use some mechanism to ensure what you write is consistent. There's not point backing up a database if you're going to get junk!
I did find this link from Swift that shows how they leveraged LD_PRELOAD and flock() to lock the Whisper files and back up the databases in a consistent state. Looks like they also open sourced the code!
In general for backing up stuff like this though:
Tar it up
Pros:
Simple
Portable
No additional tools required
Compression rate is flexible (xz, gzip, bz2)
Cons:
Potentially slow
Incremental backups are possible but a bit of a faff
Rsync it
Pros:
Also simple
Fast
Incremental backups are easy
Compression in transit
Cons:
Uses SSH so if you're not copying to a remote server might be slower than other tools
Compression not available at end without using tar/gzip etc.
There are a few options for backing up databases like this, and assuming there's an easy mechanism to ensure consistency (temporarily halting the database/locking write access, etc), they're all roughly similar.
The key thing (as Craig Estey mentions in his comment) is to use some mechanism to ensure what you write is consistent. There's not point backing up a database if you're going to get junk!
I did find this link from Swift that shows how they leveraged
LD_PRELOAD
andflock()
to lock the Whisper files and back up the databases in a consistent state. Looks like they also open sourced the code!In general for backing up stuff like this though:
Tar it up
Pros:
Cons:
Rsync it
Pros:
Cons:
Filesystem Snapshots
Pros:
Cons: