Using Gnucash from multiple computers?

John Ralls jralls at ceridwen.us
Tue Oct 14 16:24:15 EDT 2014


On Oct 14, 2014, at 11:57 AM, Sean Clarke <seanchk at gmail.com> wrote:

> Hi John,
> 
> Ok I'm not sure if I've done this right (which means I pretty sure I haven't!)
> 
> I created a .bashrc file and put it in /home
> 
No, not /home. That’s the enclosing dir for all users. Based on below you want /home/sean/.bashrc

> I created a new folder in Google Drive called gnucash 
> 
> The full path to that folder is /home/sean/Google Drive/gnucash

> 
> The content of my .bashrc file (I found an example of one online and copied it) 
> 
> PS1='\u$'	# The prompt contains the user's login name.
> 
> HISTSIZE=50	# Save 50 commands for when the user presses the up arrow.
> 
> # All the directories to search for commands.
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11
> 
> # To prevent the user from accidentally ending a login session,
> # disable Ctrl-D as a way to exit.
> IGNOREEOF=1
> 
> stty erase "^H"	# Make sure the backspace key erases.
> 
> GNC_DOT_DIR="$home/sean/Google Drive/gnucash”

No, $home is “” unless you’ve set it to something. The automatically set variable is $HOME, and it points to /home/sean. Say
  echo $HOME
to see.

In order for the environment variables declared in .bashrc to affect anything they must be exported; that can be done on the last line that defines them in the .bashrc or separately. For example
  export GNC_DOT_DIR=“$HOME/Google Drive/gnucash"

> I've restarted the PC but don't see anything different happening.

Restarting is for Windows. You need only log out and back in.

However, if you’re starting from a desktop icon or “Activities” menu or similar, you’ll need to consult your distro’s documentation to see how to set the environment for those. They may not read the bash-specific files, so you might need to use .profile or .login instead.

> 
> When I originally created the accounts files I was asked where I wanted to save them and at that point I selected a folder on Google Drive (not the same folder)

Good, you don’t want them to be in the same folder.

> 
> Can you please explain a little more what this is telling gnucash?       GNC_DOT_DIR="$home/sean/Google Drive/gnucash"    I thought it was telling it where to look for the data files but gnucash loads them from the directory I first saved them to, then I thought maybe it would save them there for next time.... but it doesn't do that...    So I'm confused as to what it is for.

No, GNC_DOT_DIR is telling GnuCash where to look for its state files, things like what accounts you had open the last time you used the account file, what size and where on the screen the window is, etc.

Other state, like what preference settings you made and what 4 files you most recently opened are kept in the OS’s preferences system, which on recent Linux distros is usually dconf.

> 
> Should I also save all the account files into /home/sean/Google Drive/gnucash    ?

No. Seriously bad things happen when you do that.

Regards,
John Ralls

> On 14 October 2014 21:06, John Ralls <jralls at ceridwen.us> wrote:
> 
> On Oct 14, 2014, at 1:20 AM, Sean Clarke <seanchk at gmail.com> wrote:
> 
>> Hi John,
>> 
>> by GNC_DOT_DIR do you mean the .gnucash directory in /home ?
>> 
>> If not then what am I looking for?
>> 
>> Also I don't have a .bashrc in /home  which is where I was expecting it.   
>> 
>> Can you give me a little more help please.
>> 
>> At the moment I have all (?) the .gnucash account data files in a folder on Google Drive and apart from having to remember to exit the program on one machine before opening it on another (because of the LCK file), everything seems fine.
> 
> Please remember to copy the list on all replies: Use "reply all" or, if your email client supports it, "reply list".
> 
> GNC_DOT_DIR is an environment variable. If it's not set the default is $HOME/.gnucash, where HOME is another environment variable pointing the user's home folder, which on Linux is /home/<username>. You want to set it like this:
> GNC_DOT_DIR="$HOME/Google Drive/gnucash"
> or something similar.
> 
> .bashrc is one of several possible names for startup files, see the bash manpage for a complete list. Note that none of them will exist unless the user explicitly creates them, and nthat bash looks for them in a particular order; once it finds one it stops looking for more.
> 
> Regards,
> John Ralls
> 
>> On 14 October 2014 09:29, John Ralls <jralls at ceridwen.us> wrote:
>> 
>> On Oct 13, 2014, at 4:58 PM, Sean Clarke <seanchk at gmail.com> wrote:
>> 
>> > Hi,
>> >
>> > Is it possible to stick the Gnucash settings file on Google Drive and then
>> > be able to use the same settings from multiple computers?
>> >
>> > I want to have Gnucash on all my computers so depending which one I'm using
>> > I have access to my financial analysis.
>> >
>> > Or will I run into problems?
>> 
>> Nope, piece of cake: Just set GNC_DOT_DIR to a folder on your Google Drive. You didn't say what OS you're using,
>> so in Linux you can just set it in .bashrc. On OSX you'll want to edit Gnucash.app/Contents/MacOS/Gnucash. On Windows
>> the easiest way is to edit the shortcut in the menu (right-click on it and select Properties from the context menu).
>> 
>> Regards,
>> John Ralls
>> 
>> 
> 
> 




More information about the gnucash-user mailing list