[GNC] .log files with sqlite backend

John Ralls jralls at ceridwen.us
Wed Apr 18 09:48:50 EDT 2018


> On Apr 18, 2018, at 12:12 AM, cicko <alen.siljak at gmx.com> wrote:
> 
> While I was using xml backend in the past couple of weeks, I finally realized
> how backup files and .log files work. I really like the scheme as, before
> that, I had a script that creates backups of sqlite book in the same manner
> (and deletes the .log files).
> 
> Now, back to using sqlite book, I notice the difference: the .log files get
> created but not the backup files. Is this intentional or accidental?
> 
> I guess it is still possible to replay the .log files that contain the
> missing transactions (in case of an error). Has anyone actually tried this
> with an sqlite book?
> 
> It's just that the automatic backup files are not generated. For this I have
> a Python script that does exactly the same as xml backup - it appends the
> date/time to the file name and copies it to the backup folder, and keeps the
> last n copies. I should probably redo that to work based on time and keep
> last n days, for example.
> 
> Just looking to get some background info to confirm the best recovery
> procedure in case of a failure.
> Cheers
It’s a side effect of the difference between a database and an XML file. The XML file is read in at the beginning of the session and a new one is written back out every n minutes and at the end of the session. The previous file is renamed at the first save, becoming the backup.

With a database, including a SQLite3 file, the storage is under the control of the database engine. In order for GnuCash to make a backup it would need to explicitly copy the SQLite3 file; even that wouldn’t necessarily be possible for a MySQL or Postgresql database.

Regards,
John Ralls



More information about the gnucash-user mailing list