Re: [GNC] .log files with sqlite backend

2018-04-20 Thread cicko
Geert Janssens-4 wrote
> The save button is permanently disabled when using an sql based book.
> 
>> So, from what I understand, the whole point of .log files is to help
>> prevent
>> losing changes if there's a crash before the user clicks Save with an xml
>> book?
>> 
> Yes.

Oh, OK. So the Save button just *looks* enabled. At least with my current
GTK skin.

Added the .log files clarification to the FAQ page on wiki.



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] .log files with sqlite backend

2018-04-19 Thread Geert Janssens
Op donderdag 19 april 2018 16:58:16 CEST schreef Alen Siljak:
> > Sent: Thursday, April 19, 2018 at 3:47 PM
> > From: "Derek Atkins" <warl...@mit.edu>
> > To: "David T. via gnucash-user" <gnucash-user@gnucash.org>
> > Cc: "alen.sil...@gmx.com" <alen.sil...@gmx.com>, "sunfis...@yahoo.com"
> > <sunfis...@yahoo.com> Subject: Re: [GNC] .log files with sqlite backend
> > 
> > So I don't see why you would want or need to replay logs with SQL.
> > Is there a specific use-case here that I missed?
> 
> Not really, except that the .log files are still created which is redundant,
> as you just confirmed. The sql backend indeed does save all the changes
> immediately and the Save button also becomes redundant.
> 
The save button is permanently disabled when using an sql based book.

> So, from what I understand, the whole point of .log files is to help prevent
> losing changes if there's a crash before the user clicks Save with an xml
> book?
> 
Yes.

Geert


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] .log files with sqlite backend

2018-04-19 Thread Alen Siljak


> Sent: Thursday, April 19, 2018 at 3:47 PM
> From: "Derek Atkins" <warl...@mit.edu>
> To: "David T. via gnucash-user" <gnucash-user@gnucash.org>
> Cc: "alen.sil...@gmx.com" <alen.sil...@gmx.com>, "sunfis...@yahoo.com" 
> <sunfis...@yahoo.com>
> Subject: Re: [GNC] .log files with sqlite backend
> 
> So I don't see why you would want or need to replay logs with SQL.
> Is there a specific use-case here that I missed?

Not really, except that the .log files are still created which is redundant, as 
you just confirmed.
The sql backend indeed does save all the changes immediately and the Save 
button also becomes redundant.

So, from what I understand, the whole point of .log files is to help prevent 
losing changes if there's a crash before the user clicks Save with an xml book?

Cheers
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] .log files with sqlite backend

2018-04-19 Thread Derek Atkins
Hi,

"David T. via gnucash-user"  writes:

> Alen,
> I think you have identified a potentially significant issue with log
> files and sql data files.  Specifically, with xml files, full
> snapshots are saved periodically, and log files are paired with these
> snapshots to enable a user to "replay" actions to recover a previous
> state. 
> It is unclear what log file playback would do to an sql data file,
> since the only saved file is constantly updated. I worry that it would
> result in a corrupted file, since I imagine it would in essence
> reapply a subset of transactions onto the file. 
> I'd be happy to be told I am wrong, but if this would be the result,
> perhaps it would be advisable for gnucash not to create log files for
> any sql back end. 
> David

I don't see any reason/need to replay a log file to a database backend.
One of the benefits of the SQL storage backend is that changes are
committed to storage immediately.  So basically, so long as you don't
have a system-wide crash, there is a very small window where you could
lose data, and at worst you'd only lose a single transaction.

So I don't see why you would want or need to replay logs with SQL.

Is there a specific use-case here that I missed?

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   warl...@mit.eduPGP key available
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Re: [GNC] .log files with sqlite backend

2018-04-18 Thread David T. via gnucash-user
Alen,
I think you have identified a potentially significant issue with log files and 
sql data files.  Specifically, with xml files, full snapshots are saved 
periodically, and log files are paired with these snapshots to enable a user to 
"replay" actions to recover a previous state. 
It is unclear what log file playback would do to an sql data file, since the 
only saved file is constantly updated. I worry that it would result in a 
corrupted file, since I imagine it would in essence reapply a subset of 
transactions onto the file. 
I'd be happy to be told I am wrong, but if this would be the result, perhaps it 
would be advisable for gnucash not to create log files for any sql back end. 
David

 
 
  On Wed, Apr 18, 2018 at 12:14, cicko 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



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
  
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Re: [GNC] .log files with sqlite backend

2018-04-18 Thread cicko
John Ralls-2 wrote
> 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.

Right, thanks, I assumed something along those lines. How does that affect
replaying the .log files, though? Is this something that could be safely
done or is it something to be avoided with sql backends?
I'm asking because -better safe than sorry. And it is still easier to ask
than to try it out and analyse the consequences. Perhaps somebody walked
down that road before. :)



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Re: [GNC] .log files with sqlite backend

2018-04-18 Thread John Ralls

> On Apr 18, 2018, at 12:12 AM, cicko  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

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Re: [GNC] .log files with sqlite backend

2018-04-18 Thread Colin Law
On 18 April 2018 at 08:12, cicko  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.
>

I suggest using the same backup procedure that you use to backup the rest
of your documents so that you always have recent backups of the file.  The
accounts file is no different from any other important documents and data
you have on your system.

I use backintime [1] but there are many other options.

Colin

[1] https://backintime.readthedocs.io/en/latest/
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] .log files with sqlite backend

2018-04-18 Thread cicko
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



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.