GnuCash - closing database from Command Line?

John Ralls jralls at ceridwen.us
Tue Aug 30 23:08:10 EDT 2016


> On Aug 29, 2016, at 3:49 PM, hirapanna via gnucash-user <gnucash-user at gnucash.org> wrote:
> 
> I have GnuCash setup on my Windows 10 desktop, with the backend database as
> MySQL. I have also set GnuCash to retrieve online quotes. I has been working
> fine for the last few years.
> 
> To update the prices, I start GnuCash, and update the prices from the Price
> Editor.
> 
> I wanted to have an automatic process to update the quotes, so I setup a
> scheduled task running a batch file. I have set it to run once a day.
> 
> The batch file is a simple invocation of GnuCash CLI as:
> 
>    gnucash.exe --add-price-quotes mysql://user:pass@server/database_name
> 
> The task executes successfully, but when I try to open the GnuCash
> application after the update, I get an error saying that the database is
> locked, and I can open it Read-Only, Create a New File, Open Anyway or Quit.
> 
> If I open the database read-only, I can go to the price editor and see when
> the price update was made. If I close GnuCash, and then open it again, I do
> not get the read-only error message.
> 
> I am curious to know what is going on. Did the CLI invocation leave the
> database open? Is there a way to close the database from command line?

Sounds like the CLI invocation might be crashing or hanging. Try running it in the same environment (i.e. cmd or PowerShell) that you're using to invoke it in scheduled tasks and see if it completes successfully and clears the lock.

Regards,
John Ralls




More information about the gnucash-user mailing list