The command gnucash-cli --quotes get
can be used to fetch the current quotes of your stocks and write them directly into your
GnuCash-data file without starting the GUI. Thus an automatic, regular updating of the price
database is possible.
Please note that the data file should not be open in another instance of
The file specified
will depend on the name and location of your data file. This can
be determined by the name displayed in the top frame of the
GnuCash window, before the
The file name can also be found under status bar.in the recently opened file list. If you place the mouse over the menu item with the number 1 in the list of recently opened files, the complete file name is displayed in the
You have to register the gnucash-cli with a scheduler in order to get Online Quotes automatically and periodically. The method depends on your OS.
Example 11.1. Automated quote retrieval every Friday at 4:00 p.m.
Procedure 11.8. On
Register gnucash-cli with
Run crontab -e.
Add the following line to your crontab:
0 16 * * 5 gnucash-cli --quotes get
> /dev/null 2>&1
If there is no graphic session that has already started the dbus, running on your computer at the time of the quote request, you must do the entry as follows instead:
0 16 * * 5 env `dbus-launch` sh -c 'trap "kill $DBUS_SESSION_BUS_PID" EXIT; gnucash-cli --quotes get
(Do not copy the line breaks into the crontab, they were inserted here only for the purpose of readability).
Procedure 11.9. On
Register gnucash-cli with Task Scheduler.
Select→ → .
Enter the appropirate items on Create Task Window.
Adjust the time to the close of the stock exchange and consider fund quotes, that the net asset value (NAV) is determined well after the markets closed. The types have their description in Section 8.6, “Price Editor”.
Some users have made additions to the wiki and shared their experiences on the Online Quotes Page on GnuCash Wiki.
 The Online Quotes Retrieval command has been changed from
GnuCash 4.0. The old command
is still available, but it
is deprecated and will be removed in the future release. If you've upgraded from
3.11 or previous version, it is recommended to use the new command