如何对SQLite执行增量备份?

时间:2021-10-10 05:30:48

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...

我有一个将日志数据保存到SQLite3数据库的程序。我想在程序还在运行时备份数据库。我已经通过使用SQLite在线备份API (http://www.sqlite.org/backup.html)完成了这一工作,而且它运行良好,但是在备份完成之前,它会延迟这个过程。

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.

有人知道如何在SQLite中做增量备份吗?我最好只备份新数据,而不是每次运行备份时备份整个数据库。

1 个解决方案

#1


3  

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.

如果您的日志数据具有时间戳,并且结构相当简单,那么您可以运行一个单独的进程来提取最近的数据并将其插入到备份流中。

#1


3  

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.

如果您的日志数据具有时间戳,并且结构相当简单,那么您可以运行一个单独的进程来提取最近的数据并将其插入到备份流中。