Difference between revisions of "Online Quotes"

From GnuCash
Jump to: navigation, search
(Needed modules)
 
Line 1: Line 1:
You need to install the Finance::Quote and Crypt::SSLeay Perl modules in order to get online quotes. The latter is a requirement inherited from the latest version of Finance::Quote, version 1.12. On Linux, these modules are packages, different from the GnuCash package.<br/>
+
You need to install several Perl modules in order to get online quotes. While the error message may be about Finance::Quote not being installed properly, that module alone is not sufficient. If it has been installed on your system, the script ''gnc-fq-update ''may be used to install the modules needed. That script, as of 2.4.0, uses CPAN to install:
 +
* LWP
 +
* Date::Manip
 +
* HTML::Parser
 +
* HTML::TableExtract
 +
* Crypt::SSLeay
 +
* Finance::Quote
 +
 
 
Then read the [http://www.gnucash.org/docs/v2.2/C/gnucash-help/acct-create.html#Online-price-setup instructions].
 
Then read the [http://www.gnucash.org/docs/v2.2/C/gnucash-help/acct-create.html#Online-price-setup instructions].
 +
 +
==Warning About Open Files==
 +
 +
Updating quotes will modify the GNUCash file/database. As multi-user access is not supported (as of 2.4), the file/database should be closed prior to updating quotes.
 +
 +
==cron and non-X usage==
 +
 +
If you attempt to run
 +
 +
gnucash --add-price-quotes /path/to/file.gnucash
 +
 +
without dbus running (for example, from a cron job or ssh without X forwarding), you may get errors such as
 +
 +
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon.
 +
See http://projects.gnome.org/gconf/ for information.
 +
(Details -  1: Not running within active session)
 +
 +
One resolution for this, courtesy of [http://www.estamos.de/blog/2009/05/08/running-syncevolution-as-cron-job/ SyncEvolution - The Missing Link] is to launch dbus for the duration of the quote retrieval with a cron command similar to
 +
 +
env `dbus-launch` sh -c 'trap "kill $DBUS_SESSION_BUS_PID" EXIT; /usr/local/bin/gnucash --add-price-quotes /path/to/file.gnucash'

Revision as of 22:06, 17 January 2011

You need to install several Perl modules in order to get online quotes. While the error message may be about Finance::Quote not being installed properly, that module alone is not sufficient. If it has been installed on your system, the script gnc-fq-update may be used to install the modules needed. That script, as of 2.4.0, uses CPAN to install:

  • LWP
  • Date::Manip
  • HTML::Parser
  • HTML::TableExtract
  • Crypt::SSLeay
  • Finance::Quote

Then read the instructions.

Warning About Open Files

Updating quotes will modify the GNUCash file/database. As multi-user access is not supported (as of 2.4), the file/database should be closed prior to updating quotes.

cron and non-X usage

If you attempt to run

gnucash --add-price-quotes /path/to/file.gnucash

without dbus running (for example, from a cron job or ssh without X forwarding), you may get errors such as

GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. 
See http://projects.gnome.org/gconf/ for information. 
(Details -  1: Not running within active session)

One resolution for this, courtesy of SyncEvolution - The Missing Link is to launch dbus for the duration of the quote retrieval with a cron command similar to

env `dbus-launch` sh -c 'trap "kill $DBUS_SESSION_BUS_PID" EXIT; /usr/local/bin/gnucash --add-price-quotes /path/to/file.gnucash'