Files, logs, etc.

Maf. King maf at chilwell.net
Mon Jan 11 10:09:10 EST 2010


On Monday 11 January 2010 14:13:11 James Wilde wrote:
> 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.

Hi James,

No, AFAIK, the .log file is opened once the main data file is loaded and 
updated "on the fly" with each new txn as you enter them. 
 
>
> 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.

No, if there is a crash, the .log file should be OK, upto and including the 
last txn you completed entering.  IIRC, certain things don't get into the log 
file  - possibly any of [new customers / vendors / scheduled txns / 
others??] - although that deficiency may be ancient history now!

>
> 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.

Yes, that is what I think.

>
> 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

I think you have to do a "log replay"  (File -> Import, IIRC) - GC doesn't 
auto-read the .log file (at least, not my 2.2.7 on SuSE, anyway)

> 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?

Yes,  you set a time to retain backup files, and those which are older than 
$NumDays will be deleted by GC (not sure if it is on file->open, or 
file->save or exit, though)

>
> 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?
>

Yes, notwithstanding the bit above about things not making it into the log 
files, which I might be wrong about anyway!

Maf.



> TIA
>
> //James
>
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



-- 
Maf. King
PGP Key fingerprint = 8D68 A91F 733B 2C1F 43B7  2B7C E591 E8E1 0DE7 C542




More information about the gnucash-user mailing list