Cron Job and Script for price-update

Colin Law clanlaw at gmail.com
Tue Apr 1 09:29:31 EDT 2014


On 1 April 2014 14:02, Abhijit Kshirsagar <abhijit86k at gmail.com> wrote:
> Hi all,
> I saw the FAQ section on cron based price updates
> (http://wiki.gnucash.org/wiki/Online_Quotes#cron_and_Non-X_Usage) and
> wrote a small script that basically does:
>
> - Check if LCK file exists, if it does, just exit
> - set http_proxy env variable
> - update prices using the env `dbus-launch ` ... command
>
> I added this script to cron, The prices were not getting updated, so i
> tried running this script when logged in through ssh - and that
> worked.
> I tried using just the "env 'dbus-launch ----" command (not my script)
> in cron, and that didn't work either.
>
> I no longer see the Dbus error in the cron output which is mailed to
> me in /var/mail:
> (GConf Error: No D-BUS daemon running)
>
> But I do see one error:
> ERROR: Undefined variable: gnc-is-debugging
>
> So the question is - what is the difference in the cron and ssh instances?

Is it the users crontab or root's?

Are you changing to the correct directory explicitly in the script?

Most likely though it is an environment variable not set as cron does
not set the full environment.  Google for cron environment to get
information on this and what to do about it.

Colin


More information about the gnucash-user mailing list