[GNC] Is there a way to handle same-named GnuCash files sensibly?

Chris Green cl at isbd.net
Wed May 4 16:02:40 EDT 2022


On Wed, May 04, 2022 at 09:26:51PM +0200, Geert Janssens wrote:
> Op dinsdag 3 mei 2022 18:37:20 CEST schreef Chris Green:
> > GnuCash names files in ~/.local/share/gnucash/books according to the
> > filename of the GnuCash data file.  This is a bit of a problem for me
> > because I expect to be able to have multiple GnuCash data files with
> > the same name in different places.
> > 
> In theory gnucash should be able to handle this. If the file name already exists in the books 
> directory, gnucash will create the new file in there with a number appended to the name. To 
> find the proper file in book matching the building.gnucash file you just opened, it uses a 
> unique book guid that's stored inside each of the files in the books directory. I don't know 
> however how these unique id's are generated or how their uniqueness is guaranteed. So 
> depending on how you make new gnucash files for each year, this may or may not work.
> 
Yes, I noticed too that there a files with a number added to the base
name, e.g.:-

    building.gnucash.gcm
    building.gnucash_2.gcm

... but I'm not sure that it's a perfect system.

I have reverted to having the year as part of the file name and a
wrapper script that finds the data file corresponding to the year
directory I'm in.

I.e. if I'm in directory /home/chris/pcc/2021 and I run the wrapper
script 'gnc' it will run gnucash with data file general2021.gnucash.
It seems pretty much OK so far and saves a lot of typing of long names.


-- 
Chris Green


More information about the gnucash-user mailing list