After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 600574 - Would like to disable creation of log files and backup files entirely
Would like to disable creation of log files and backup files entirely
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.2.x
Other All
: Normal enhancement
: ---
Assigned To: Geert Janssens
Andreas Köhler
Depends on:
Blocks:
 
 
Reported: 2009-11-03 17:37 UTC by Sam Morris
Modified: 2018-06-29 22:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to allow users to disable log/backup file retention (2.13 KB, patch)
2010-06-12 12:05 UTC, Geert Janssens
reviewed Details | Review

Description Sam Morris 2009-11-03 17:37:03 UTC
Every non-technical user I have ever set Gnucash up with has, at some point, managed to open one of the automatically-created backup files, rather than their main data file, and then happily enter data into this file. They don't notice that they've done this until they open their original, main data file, and find out that they have lost several weeks of work. That's usually the point where they ask me to help them. :)

Unpicking such a mess can be quite time consuming, because often they will save the main account file after they open it, so I have to search through each one of the backup files in reverse-chronological order to find out which one has become their new main account file.

One user even managed to do this several times in a row, so I ended up with a filename such as GNUCASH.xac.20091015175050.xac.200910051440.xac.200908221451.xac...

So: I would like for there to be an option in the preferences to disable the creation of these backup and log files. For the non-technical users I have encountered, they have lost work due to their creation, but have never had gnucash corrupt their account file... :)

I tried to do this by setting the retention time to 0 days, but this doesn't seem to work.
Comment 1 Christian Stimming 2009-11-05 12:33:11 UTC
> I tried to do this by setting the retention time to 0 days, but this doesn't
> seem to work.

At which OS/Version this didn't work? I thought it indeed works correctly.
Comment 2 Sam Morris 2009-11-05 13:22:23 UTC
Debian 5.0 and testing/unstable with both 2.2.6 and 2.2.9. Also Ubuntu 8.04 with Gnucash 2.2.4.

I just noticed that there is a tooltip for the 'retain log files' that says that 0 = never delete. So I guess setting this to 1 is as close as I can get for the moment.
Comment 3 Geert Janssens 2010-06-12 12:05:46 UTC
Created attachment 163467 [details] [review]
Patch to allow users to disable log/backup file retention

The attached patch slightly changes the way the "Retain log files" preference setting works.

Setting this to:
1-99999: retain log/backup files for so many days
0      : don't retain log/backup files at all (before: keep forever)
-1     : keep log/backup files forever

I believe this order makes the most logical sense.

There's two things that keep me from committing this patch at once:
1. The development tree is currently in string freeze, and this patch changes one string.
2. The change in behavior might result in the unwanted removal of log/backup files when upgrading from 2.2.x to 2.4.x if the user's preference was set to 0.
Comment 4 Christian Stimming 2010-06-12 13:57:30 UTC
I don't like the idea of changing the semantics of the existing preference (here: retain = 0) so drastically. Instead, from a user perspective, I'd like to see this change being implemented as a new element in the preferences. Ideally as a radiobox: "[ ] Disable log files  [ ] Enable log file and keep for [...] days", similar to the date chooser (absolute vs. relative dates) of the reports. With such a combination, the semantics of the existing preference don't have to be changed.
Comment 5 David 2010-06-12 18:19:45 UTC
Christian-- 
Personally, as an end user, I disagree. To me, the original setting (0 = Keep forever) is entirely unintuitive, and contrary to common sense. To my mind, '0' equates with 'Nothing', which Geert's change would support.

Thinking further, however, I am reminded that the Gnucash preferred mode of handling defaults is that the null instance should always give the bestest result. In this case, retaining logs and backups is clearly the preferred default, and so the 0 instance should retain logs.

Perhaps it would be better ultimately to change the storage of backup and log files so that these files would reside in a different folder or folders. Placing these files into a preference-defined Backups and/or Logfiles folder might alleviate the original problem, while still allowing the preference settings Christian wants to see.

David
Comment 6 Christian Stimming 2010-06-16 07:26:29 UTC
> Personally, as an end user, I disagree. To me, the original setting (0 = Keep
> forever) is entirely unintuitive, and contrary to common sense.

This is true and I agree entirely. I wasn't discussing whether the original semantics of this setting is intuitive or not. My point is that the original semantics is what it is, and if we want to change it, we must change it in a backwards-compatible way but not by switching its meaning into the exact opposite. The easy patch proposed by Geert unfortunately means turning a "save forever" into a "delete immediately" without any further confirmation or explanation, and this is too drastic a change.
Comment 7 Geert Janssens 2010-06-16 08:18:05 UTC
I am working on an improved patch. I expect to have it ready in a couple of days.

This patch will add radio buttons that allow the user to choose between keeping logs forever, never keeping logs or keep logs for a given number of days. I intend to respect the "0 days means keep forever" twist, although I think it makes sense to prevent the user from explicitly setting this in the future. If someone wishes to keep logs forever, he/she can do so by selecting the proper radio button.
Comment 8 Christian Stimming 2010-06-16 08:28:35 UTC
Yes, sounds very good!
Comment 9 David 2010-06-16 15:43:23 UTC
+1

Hiding the actual value is best from the end user perspective. I hope that the code is extremely clear about the idiosyncratic variable settings.
Comment 10 Geert Janssens 2010-06-19 14:59:11 UTC
This problem has been fixed in the development version, r19278. The fix will be available in the next major software release. Thank you for your bug report.

Some notes on the implementation:
- By adding radio buttons to the preferences dialog, the glade file was completely redone by glade3. I did verify that none of the important widget id's changed in the process, so this should continue to work as expected.
- If 0 days was set in gconf, I won't touch that value unless the user explicitly changes it in the preferences dialog. This is to remain backwards compatible with older versions of GnuCash, just in case a user is using multiple versions (the scenario where a user is testing a new release shouldn't affect his work in the stable release).
- I do set the gconf parameter retain_type to "forever" though if 0 days was set and prevent the user from entering 0 in the preferences in the new gnucash. This will ensure that both new and old versions of GnuCash interpret the values properly.
Comment 11 Geert Janssens 2010-06-19 15:00:28 UTC
Comment on attachment 163467 [details] [review]
Patch to allow users to disable log/backup file retention

Superseded by commit r19278
Comment 12 John Ralls 2018-06-29 22:30:21 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=600574. Please update any external references or bookmarks.