Files, logs, etc.

James Wilde james.wilde at sunde-wilde.com
Mon Jan 11 09:13:11 EST 2010


I'm trying to understand the system of files and I think I've got it more or less.  Can some kind soul tell me if I'm right or correct me if I'm wrong.

Let's say my accounts file is called Accounts.

I open GC and it opens the last Accounts file.

I add a transaction and don't save.  Accounts remains as it was, there may be a temporary file somewhere, but the information about the transaction may just be held in memory.  No other files exist yet.

I add another transaction and don't save.  Same as above.

I press 'Save'.  Accounts is now renamed as Accounts.<date><time1>.xac (i.e. the original Accounts file without the transactions), a file is created called Accounts.<date><time1>.log containing the transactions, and a new file, Accounts is created, containing the original status when I started GC plus the two transactions I have made.  If I have a crash before pressing save, the two transactions are lost.

I press 'Save' again.  Accounts is now renamed as Accounts.<date><time2>.xac, an empty file, Accounts.<date><time2>.log, is created and a new file, Accounts is created which is identical to Accounts.<date><time2>.xac.

So at any time I can delete all the .xac and .log files in my directory, and GC will next time open the Accounts file and everything will be as it should be.

If Accounts becomes corrupt, I can rename Accounts.<date><time2>.xac to Accounts and I'm going again.  Or I can open Accounts.<date><time1>.xac and GC will read Accounts.<date><time1>.log and Accounts.<date><time2>.log and upon my pressing 'Save' it will create a file called Accounts which includes all my transactions including the two above.  In fact if I have a whole chain of .xac and .log files, I can open any .xac file and GC will read all subsequent .log files and generate my Accounts file again.  Right now I have about thirty of each in my Accounts folder, and I'm thinking of reducing the number of log files down to, say, three.  If I make this change manually in preferences, will the excess .xac and .log files be automatically removed?

And basically, if I take a copy of the latest .xac file and the latest .log file, I can recreate my Accounts file with all the latest saved transactions?

TIA

//James




More information about the gnucash-user mailing list