[GNC] Gnucash logs

Geert Janssens geert.gnucash at kobaltwit.be
Thu Apr 30 05:24:03 EDT 2020


Op donderdag 30 april 2020 06:04:10 CEST schreef Chris Good:
> Hi Geert,
> 
> 
> 
> I think options 2-5 are too disruptive and more work than the benefits
> deserve.
> 
> 
> 
> Re option 1,
> 
> I’d prefer to put logs and backups in separate folders. Maybe (going with
> your name) book.dir/backup and book.dir/log. Many people seem to be
> confused about what all these long filenames are when mixed together.
> 
I see I didn't mention this, but that making separate subdirectories for those was also intended 
in my suggestion.
> 
> 
> Also putting the metadata (book.gcm) in book.dir would make if hard to
> notice, so I think it should be in the folder holding book.gnucash (or
> maybe a separate ‘metadata’ subfolder as some people think the metadata
> file is their book).

I'm not decided on whether this is a good idea yet. I was throwing it in for further consideration. 
Note that if we do switch to a model with a data file and associated directory for other stuff, the 
metadata file could just be called that - metadata.gcm. It's already in the directory with the 
same name as the book. No need to keep that file itself named as the book is.

For that matter even the log and backups files could be reduced in file name length to only the 
timestamp. The same applies, the base directory (book.dir) uniquely identifies which book they 
belong to.

> 
> Not having all the metadata files for multiple books in the same folder
> means it is more fiddly to share metadata between multiple books by giving
> the books the same name (books in different directories) but there is
> probably nobody doing that anyway (as it is easy to get confused about
> which book is open).
> 
Well, actually you can't. GnuCash has guards in place that make each file name in the current 
metadata directory unique. The filename is just a first indication. The actual match between 
your book and the metadata file is done by comparing the root account's GUID in your book with 
the GUID stored in the metadata file.
So if you would have two books named "book.gnucash", you will end up with a "books.gcm" and 
a "books-1.gcm" metadata file. As they are created for diferent books, they will both store a 
unique GUID. When opening either book, gnucash will check both metadata files for the one that 
has your book's GUID stored in it.

And yes, you could thus circumvent that safety measure by manipulating your books to have 
the same root account GUID. But that's not what the system was designed for so we can ignore 
that hack in this discussion :)

Regards,

Geert
> 
> 
> Regards,
> 
> Chris Good
> 
> 
> 
> From: Geert Janssens <geert.gnucash at kobaltwit.be>
> Sent: Wednesday, 29 April 2020 7:57 PM
> To: gnucash-user at gnucash.org
> Cc: Chris Good <goodchris96 at gmail.com>; 'David T.' <sunfish62 at yahoo.com>;
> 'David H' <hellvee at gmail.com> Subject: Re: [GNC] Gnucash logs
> 
> 
> 
> Hi,
> 
> 
> 
> For the file based books (xml and sqlite) there are several approaches:
> 
> 
> 
> 1. Have a book.gnucash and a book.dir side by side, per book you create.
> 
> book.gnucash is your actual data file.
> 
> book.dir is a directory containing extra files related to this data file.
> These include log files, backup files and can potentially be extended to
> hold attachments and possibly book metadata
> 
> Advantages:
> 
> - all data related to one book is stored together in one place. No
> intermingling of (meta)data with other books. Makes it easy to move a book
> to somewhere else
> 
> - as the main book is outside of the the directory it's easy to spot your
> book to open it.
> 
> Disadvantage: per book you will have two items: a file and a directory. At
> the file management level you always have to treat them as one (move them
> together, back them up together,...)
> 
> 
> 
> 2. Have a directory book.gnucash and store all data in there in a structured
> form (logs in their own subdirectory,...). To save a book, you enter the
> book's name and gnucash will create that directory for you. Inside the
> directory your book will now have a generic name (as the directory already
> indicates the unique name) as would log files and backup files. To open a
> book, you select the directory in gnucash and it will open the actual book
> inside of it for you. Backup management could be integrated in gnucash.
> 
> Advantages:
> 
> - like option 1, all data related to a single book is encapsulated closely
> together.
> 
> - only one single element on the file system level to remember: the book.dir
> is your book. Makes it slightly easier to move things around, make backups
> and so on.


More information about the gnucash-user mailing list