GNOME Bugzilla – Bug 600574
Would like to disable creation of log files and backup files entirely
Last modified: 2018-06-29 22:30:21 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.
> 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.
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.
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.
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.
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
> 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.
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.
Yes, sounds very good!
+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.
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 on attachment 163467 [details] [review] Patch to allow users to disable log/backup file retention Superseded by commit r19278
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.