Skip to content

Store log and backup files in logs subdirectory#2182

Open
jshrek wants to merge 1 commit intoGnucash:stablefrom
jshrek:stable
Open

Store log and backup files in logs subdirectory#2182
jshrek wants to merge 1 commit intoGnucash:stablefrom
jshrek:stable

Conversation

@jshrek
Copy link
Copy Markdown

@jshrek jshrek commented Feb 20, 2026

When opening a .gnucash file, GnuCash creates:

  • a .log file
  • timestamped backup files (e.g. .YYYYMMDD.gnucash)

This change creates a "logs" subdirectory beside the main data file and writes the .log and timestamped backup files into that directory (creating it if needed).

The .LCK lock file remains in the same directory as the main .gnucash file (unchanged).

@jshrek
Copy link
Copy Markdown
Author

jshrek commented Feb 20, 2026

Copy link
Copy Markdown
Member

@jralls jralls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior change must be optional.

This would fix Bug 619119, but the two bugs marked duplicates of that one request that the user be able to specify the log directory. Although not articulated, some might want to specify the backup directory separately. Regardless, the commit message needs to conform to the bug-fix format

Although the DBI/SQL backend doesn't make backup files it does write transaction logs so the log basename change must apply there as well (it's in libgnucash/backend/dbi/gnc-backend-dbi.cpp).

These are C++ files, so please use the C++ string and boost::filesystem functions instead of GLib ones. Note that there are already some standard file-path facilities in libgnucash/core-utils/gnc-filepath-utils. It would be reasonable to add the log and backup directory functions there.

Please don't litter your code with comments that state the obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants