如何为SQLite进行增量备份? [英] How do I do incremental backups for SQLite?
问题描述
我有一个程序可以将日志记录数据保存到SQLite3数据库中.我想在程序仍在运行时备份数据库.我已经使用SQLite在线备份API( http://www.sqlite.org/backup.html ),并且工作正常,但是会拖延整个过程,直到备份完成...
I have a program that saves logging data to an SQLite3 database. I would like to back up the database while the program is still running. I have accomplished this by using the SQLite Online Backup API (http://www.sqlite.org/backup.html) and it works fine, however it lags the process until the backup is complete...
有人知道在SQLite中执行增量备份的方法吗?我最好只备份新数据,而不是每次运行备份时备份整个数据库.
Does anyone know of a way to do incremental backups in SQLite? I would preferably only backup new data, not the entire database each time I run the backup.
推荐答案
我认为没有通用的解决方案可以解决您的问题.
I don't think there is a general purpose solution to your problem.
如果您的日志记录数据带有时间戳,并且结构合理, 您可以运行一个单独的过程来提取最新数据并将其插入 进入备份流.
If your logging data is timestamped and reasonably simple in structure, you could run a separate process to extract recent data and insert it into your backup stream.
这篇关于如何为SQLite进行增量备份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!