How to share data across multiple machines
Jonathan Kamens
jik at kamens.us
Fri Jan 31 10:15:58 EST 2014
On 01/31/2014 08:38 AM, Yawar Amin wrote:
> On 2014-01-31, at 6:43, Jonathan Kamens <jik at kamens.us> wrote:
>> Why won't there be a lock when Dropbox is used? As far as I can tell, the lock is just a file that GnuCash creates in the filesystem in the same directory as the data file when it starts up, so when it creates that file, shouldn't Dropbox automatically sync it to the other machine(s)?
> If Dropbox replicates a lock file on a second machine, won't the GnuCash instance running on the second machine think that the lock belongs to _it_?
Not exactly. Here is my understanding of how things work (happy to be
corrected if I've got it wrong!)...
If you start GnuCash and it sees that the lock file already exists, you
are offered four choices: Open Read-Only, Create New File, Open Anyway,
and Quit. We can ignore Create New File and Quit since they don't help
us run GnuCash in two places at the same time. ;-) That leaves Open
Read-Only and Open Anyway.
Let's say that you do Open Read-Only, which means that you now have two
different GnuCash instances running, which we'll call RW and RO. In RW,
you will be able to continue to modify your data, but in RO, you can
only view it. If you want to see changes in RO that were made in RW, you
need to do File | Revert.
If, on the other hand, you do Open Anyway, then you'll now be able to
modify your data in /both/ GnuCash instances. I suppose that
theoretically, if you always, absolutely, positively remember to save
changes in one instance, wait for it to sync (if you're using Dropbox),
and then do File | Revert in the other instance before making changes
there, this would work. But frankly it sounds really, incredibly
dangerous and I wouldn't recommend it.
I'm not certain, but I don't think GnuCash has any sort of conflict
detection, i.e., if you have two instances running, make changes in
both, and then save the changes in both, I don't think the second
instance will complain that you've just overwritten changes you made in
another instance.
In short, you're safe as long as you pay attention to the lock files and
don't try to open your data read-write in multiple places at the same time.
jik
More information about the gnucash-user
mailing list