logoalt Hacker News

hedoratoday at 3:42 PM2 repliesview on HN

Does cp actually work on live sqlite files? I wouldn’t expect it to, since cp does not create a crash-consistent snapshot.


Replies

sgbealtoday at 6:47 PM

> Does cp actually work on live sqlite files? I wouldn’t expect it to, since cp does not create a crash-consistent snapshot.

cp "works" but it has a very strong possibility of creating a corrupt copy (the more active the db, the higher the chance of corruption). Anyone using "cp" for that purpose does not have a reliable backup.

sqlite3_rsync and SQLite's "vacuum into" exist to safely create backups of live databases.

66yatmantoday at 9:00 PM

Maybe if the system is idle